[Bf-blender-cvs] [4a09907eab2] blender-v2.92-release master: Fix T84049: Crash when using Cycles Progressive Refine with OptiX+CPU

Patrick Mours noreply at git.blender.org
Wed Jan 20 14:41:17 CET 2021


Commit: 4a09907eab2a3b6da53b1942aebefdcf58bbd604
Author: Patrick Mours
Date:   Wed Jan 20 14:12:43 2021 +0100
Branches: blender-v2.92-release master
https://developer.blender.org/rB4a09907eab2a3b6da53b1942aebefdcf58bbd604

Fix T84049: Crash when using Cycles Progressive Refine with OptiX+CPU

Tile stealing may steal a CPU tile buffer and move it to the GPU, but next time around that
tile may be re-used on the CPU again (in progressive refinement mode). The buffer would
still be on the GPU then though, so is inaccessible to the CPU. As a result Blender crashed
when the CPU tried to write results to that tile buffer.
This fixes that by ensuring a stolen tile buffer is moved back to the device it is used on before
rendering.

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

M	intern/cycles/render/session.cpp

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

diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp
index 0debc08d911..f3cdae77d47 100644
--- a/intern/cycles/render/session.cpp
+++ b/intern/cycles/render/session.cpp
@@ -540,6 +540,10 @@ bool Session::acquire_tile(RenderTile &rtile, Device *tile_device, uint tile_typ
     tile->buffers = new RenderBuffers(tile_device);
     tile->buffers->reset(buffer_params);
   }
+  else if (tile->buffers->buffer.device != tile_device) {
+    /* Move buffer to current tile device again in case it was stolen before. */
+    tile->buffers->buffer.move_device(tile_device);
+  }
 
   tile->buffers->map_neighbor_copied = false;



More information about the Bf-blender-cvs mailing list