[Bf-blender-cvs] [b383bf6f002] cycles-x: Cycles X: Use queue for data transfer in naive GPU update

Sergey Sharybin noreply at git.blender.org
Mon May 17 15:22:07 CEST 2021


Commit: b383bf6f002ae6f61cabe759f253eb4cb472bd86
Author: Sergey Sharybin
Date:   Mon May 17 15:18:48 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBb383bf6f002ae6f61cabe759f253eb4cb472bd86

Cycles X: Use queue for data transfer in naive GPU update

Run into this code while looking into the following issue:
when using non-display GPU and OpenImageDenoiser in viewport
sometimes during navigation the viewport goes blank.

This change seems to either fix this issue (although, not
entirely sure why, because from my understanding all the calls
were already properly synchronized).

In any case, using a queue for data transfers and kernel is
more correct way to go.

If the issue described above ever comes back we will dig
deeper.

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

M	intern/cycles/integrator/path_trace_work_gpu.cpp

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

diff --git a/intern/cycles/integrator/path_trace_work_gpu.cpp b/intern/cycles/integrator/path_trace_work_gpu.cpp
index aef4ad27c6a..dc51f9f350e 100644
--- a/intern/cycles/integrator/path_trace_work_gpu.cpp
+++ b/intern/cycles/integrator/path_trace_work_gpu.cpp
@@ -593,14 +593,13 @@ void PathTraceWorkGPU::copy_to_gpu_display_naive(GPUDisplay *gpu_display, float
     gpu_display_rgba_half_.alloc(width, height);
     /* TODO(sergey): There should be a way to make sure device-side memory is allocated without
      * transfering zeroes to the device. */
-    gpu_display_rgba_half_.zero_to_device();
+    queue_->zero_to_device(gpu_display_rgba_half_);
   }
 
   enqueue_film_convert(gpu_display_rgba_half_.device_pointer, sample_scale);
+  queue_->copy_from_device(gpu_display_rgba_half_);
   queue_->synchronize();
 
-  gpu_display_rgba_half_.copy_from_device();
-
   gpu_display->copy_pixels_to_texture(gpu_display_rgba_half_.data());
 }



More information about the Bf-blender-cvs mailing list