Fix OpenCL render error in large scenes

In scenes such as Cosmos Laundromat, there were memory allocations bigger than
2GB which would overflow.

Problem and solution found by AMD, thanks!
This commit is contained in:
Brecht Van Lommel 2020-09-17 13:07:28 +02:00 • committed by Jeroen Bakker
parent 6144b5bd4e
commit 094addfe84

View file

@ -65,7 +65,7 @@ void MemoryManager::DeviceBuffer::update_device_memory(OpenCLDevice *device)
}
/* Always allocate non-empty buffer, NULL pointers cause problems with some drivers. */
total_size = max(total_size, 16);
total_size = std::max(total_size, (size_t)16);
if (need_realloc) {
cl_ulong max_buffer_size;