diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-07-01 20:45:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-07-01 21:01:25 +0300 |
commit | 792cb8bdc7f5d9432c89750d7a09e797137a6a00 (patch) | |
tree | 469ed5d54749b1584b671ab9409110b0261136c9 /intern/cycles/device | |
parent | 755c5c6e4c86fed28646c18f0a78a5fa9c0fd4d6 (diff) |
Fix T77984: Cycles OpenCL error rendering empty scene
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/opencl/memory_manager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/device/opencl/memory_manager.cpp b/intern/cycles/device/opencl/memory_manager.cpp index fedb3ea8c6a..0285dc969ec 100644 --- a/intern/cycles/device/opencl/memory_manager.cpp +++ b/intern/cycles/device/opencl/memory_manager.cpp @@ -64,6 +64,9 @@ void MemoryManager::DeviceBuffer::update_device_memory(OpenCLDevice *device) total_size += alloc_size; } + /* Always allocate non-empty buffer, NULL pointers cause problems with some drivers. */ + total_size = max(total_size, 16); + if (need_realloc) { cl_ulong max_buffer_size; clGetDeviceInfo( @@ -251,7 +254,7 @@ void MemoryManager::set_kernel_arg_buffers(cl_kernel kernel, cl_uint *narg) device->kernel_set_args(kernel, (*narg)++, *device_buffer.buffer); } else { - device->kernel_set_args(kernel, (*narg)++, 0); + device->kernel_set_args(kernel, (*narg)++); } } } |