[Bf-blender-cvs] [094addfe84c] blender-v2.83-release: Fix OpenCL render error in large scenes

Brecht Van Lommel noreply at git.blender.org
Wed Oct 7 10:23:17 CEST 2020


Commit: 094addfe84cd7404e5806a99da47f643e0321541
Author: Brecht Van Lommel
Date:   Thu Sep 17 13:07:28 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB094addfe84cd7404e5806a99da47f643e0321541

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!

===================================================================

M	intern/cycles/device/opencl/memory_manager.cpp

===================================================================

diff --git a/intern/cycles/device/opencl/memory_manager.cpp b/intern/cycles/device/opencl/memory_manager.cpp
index 0285dc969ec..4330e07cb37 100644
--- a/intern/cycles/device/opencl/memory_manager.cpp
+++ b/intern/cycles/device/opencl/memory_manager.cpp
@@ -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;



More information about the Bf-blender-cvs mailing list