diff options
Diffstat (limited to 'intern/cycles/device/device.cpp')
-rw-r--r-- | intern/cycles/device/device.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index 5f01bd535d0..0c20270ea42 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -90,24 +90,6 @@ Device::~Device() } } -void Device::pixels_alloc(device_memory& mem) -{ - mem_alloc("pixels", mem, MEM_READ_WRITE); -} - -void Device::pixels_copy_from(device_memory& mem, int y, int w, int h) -{ - if(mem.data_type == TYPE_HALF) - mem_copy_from(mem, y, w, h, sizeof(half4)); - else - mem_copy_from(mem, y, w, h, sizeof(uchar4)); -} - -void Device::pixels_free(device_memory& mem) -{ - mem_free(mem); -} - /* TODO move shaders to standalone .glsl file. */ const char *FALLBACK_VERTEX_SHADER = "#version 330\n" @@ -257,7 +239,9 @@ void Device::draw_pixels( bool transparent, const DeviceDrawParams &draw_params) { const bool use_fallback_shader = (draw_params.bind_display_space_shader_cb == NULL); - pixels_copy_from(rgba, y, w, h); + + assert(mem.type == MEM_PIXELS); + mem_copy_from(rgba, y, w, h, rgba.memory_elements_size(1)); GLuint texid; glGenTextures(1, &texid); @@ -526,10 +510,13 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo>& subdevices, int th info.has_bindless_textures = true; info.has_volume_decoupled = true; info.has_qbvh = true; + info.has_osl = true; + foreach(const DeviceInfo &device, subdevices) { info.has_bindless_textures &= device.has_bindless_textures; info.has_volume_decoupled &= device.has_volume_decoupled; info.has_qbvh &= device.has_qbvh; + info.has_osl &= device.has_osl; if(device.type == DEVICE_CPU && subdevices.size() > 1) { if(background) { @@ -572,16 +559,4 @@ void Device::free_memory() devices.free_memory(); } - -device_sub_ptr::device_sub_ptr(Device *device, device_memory& mem, int offset, int size, MemoryType type) - : device(device) -{ - ptr = device->mem_alloc_sub_ptr(mem, offset, size, type); -} - -device_sub_ptr::~device_sub_ptr() -{ - device->mem_free_sub_ptr(ptr); -} - CCL_NAMESPACE_END |