[Bf-blender-cvs] [6a4f4810f38] blender-v3.3-release: Fix T100246: Cycles GPU render error when adding AO node during viewport render

Brecht Van Lommel noreply at git.blender.org
Thu Aug 18 20:16:50 CEST 2022


Commit: 6a4f4810f38b2efc49d55dad6960f610f166773f
Author: Brecht Van Lommel
Date:   Thu Aug 18 20:00:16 2022 +0200
Branches: blender-v3.3-release
https://developer.blender.org/rB6a4f4810f38b2efc49d55dad6960f610f166773f

Fix T100246: Cycles GPU render error when adding AO node during viewport render

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

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 fa313f6460a..ee250a6916b 100644
--- a/intern/cycles/integrator/path_trace_work_gpu.cpp
+++ b/intern/cycles/integrator/path_trace_work_gpu.cpp
@@ -204,22 +204,26 @@ void PathTraceWorkGPU::alloc_integrator_sorting()
     integrator_state_gpu_.sort_key_counter[DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE] =
         (int *)integrator_shader_sort_counter_.device_pointer;
 
-    if (device_scene_->data.kernel_features & KERNEL_FEATURE_NODE_RAYTRACE) {
+    integrator_shader_sort_prefix_sum_.alloc(sort_buckets);
+    integrator_shader_sort_prefix_sum_.zero_to_device();
+  }
+
+  if (device_scene_->data.kernel_features & KERNEL_FEATURE_NODE_RAYTRACE) {
+    if (integrator_shader_raytrace_sort_counter_.size() < sort_buckets) {
       integrator_shader_raytrace_sort_counter_.alloc(sort_buckets);
       integrator_shader_raytrace_sort_counter_.zero_to_device();
       integrator_state_gpu_.sort_key_counter[DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE] =
           (int *)integrator_shader_raytrace_sort_counter_.device_pointer;
     }
+  }
 
-    if (device_scene_->data.kernel_features & KERNEL_FEATURE_MNEE) {
+  if (device_scene_->data.kernel_features & KERNEL_FEATURE_MNEE) {
+    if (integrator_shader_mnee_sort_counter_.size() < sort_buckets) {
       integrator_shader_mnee_sort_counter_.alloc(sort_buckets);
       integrator_shader_mnee_sort_counter_.zero_to_device();
       integrator_state_gpu_.sort_key_counter[DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE] =
           (int *)integrator_shader_mnee_sort_counter_.device_pointer;
     }
-
-    integrator_shader_sort_prefix_sum_.alloc(sort_buckets);
-    integrator_shader_sort_prefix_sum_.zero_to_device();
   }
 }



More information about the Bf-blender-cvs mailing list