diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-10-13 11:34:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-10-13 12:20:25 +0300 |
commit | f12513a21ccef5133baa4144074a8a20db2cc5b4 (patch) | |
tree | 76eee4571aeda4d2baa4fc33cda5a57d902f4b56 /intern | |
parent | 9c412b6e2d4d5ae3c0cbd4a8d0249a3c12c6bd65 (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/integrator/pass_accessor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |