Fix T77984: Cycles OpenCL error rendering empty scene

This commit is contained in:
Brecht Van Lommel 2020-07-01 19:45:56 +02:00
parent 755c5c6e4c
commit 792cb8bdc7
Notes: blender-bot 2023-02-13 23:39:48 +01:00
Referenced by issue #77984, Blender 2.83 will crash while rendering with amd rx 590 and hidding the meshes
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 4 additions and 1 deletions

View File

@ -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)++);
}
}
}