[Bf-blender-cvs] [f12513a21cc] master: Fix Cycles backing issues when using multiple devices

Sergey Sharybin noreply at git.blender.org
Wed Oct 13 11:20:30 CEST 2021


Commit: f12513a21ccef5133baa4144074a8a20db2cc5b4
Author: Sergey Sharybin
Date:   Wed Oct 13 10:34:17 2021 +0200
Branches: master
https://developer.blender.org/rBf12513a21ccef5133baa4144074a8a20db2cc5b4

Fix Cycles backing issues when using multiple devices

The pixel accessor was not aware of possible offset in the
pixel padding causing some slices of the result not being
properly padded.

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

M	intern/cycles/integrator/pass_accessor.cpp

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

diff --git a/intern/cycles/integrator/pass_accessor.cpp b/intern/cycles/integrator/pass_accessor.cpp
index 4a0b1ed6ece..4ef9ce7ef42 100644
--- a/intern/cycles/integrator/pass_accessor.cpp
+++ b/intern/cycles/integrator/pass_accessor.cpp
@@ -98,7 +98,10 @@ static void pad_pixels(const BufferParams &buffer_params,
 
   const size_t size = static_cast<size_t>(buffer_params.width) * buffer_params.height;
   if (destination.pixels) {
-    float *pixel = destination.pixels;
+    const size_t pixel_stride = destination.pixel_stride ? destination.pixel_stride :
+                                                           destination.num_components;
+
+    float *pixel = destination.pixels + pixel_stride * destination.offset;
 
     for (size_t i = 0; i < size; i++, pixel += dest_num_components) {
       if (dest_num_components >= 3 && src_num_components == 1) {
@@ -113,7 +116,7 @@ static void pad_pixels(const BufferParams &buffer_params,
 
   if (destination.pixels_half_rgba) {
     const half one = float_to_half(1.0f);
-    half4 *pixel = destination.pixels_half_rgba;
+    half4 *pixel = destination.pixels_half_rgba + destination.offset;
 
     for (size_t i = 0; i < size; i++, pixel++) {
       if (dest_num_components >= 3 && src_num_components == 1) {



More information about the Bf-blender-cvs mailing list