[Bf-blender-cvs] [0194e54fd32] master: Fix compilation error with MSVC

Sergey Sharybin noreply at git.blender.org
Wed Oct 6 16:51:12 CEST 2021


Commit: 0194e54fd3276a722ea5c2a8cdff6486c30dcbad
Author: Sergey Sharybin
Date:   Wed Oct 6 16:49:20 2021 +0200
Branches: master
https://developer.blender.org/rB0194e54fd3276a722ea5c2a8cdff6486c30dcbad

Fix compilation error with MSVC

MSVC does not support variable size array definition.
Use maximum possible stack, similar to the GPU case.

Not expected to have user-measurable difference.

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

M	intern/cycles/kernel/integrator/integrator_intersect_volume_stack.h

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

diff --git a/intern/cycles/kernel/integrator/integrator_intersect_volume_stack.h b/intern/cycles/kernel/integrator/integrator_intersect_volume_stack.h
index 99f6cf35e9e..00e90701d19 100644
--- a/intern/cycles/kernel/integrator/integrator_intersect_volume_stack.h
+++ b/intern/cycles/kernel/integrator/integrator_intersect_volume_stack.h
@@ -42,7 +42,7 @@ ccl_device void integrator_volume_stack_update_for_subsurface(INTEGRATOR_STATE_A
   const uint volume_stack_size = kernel_data.volume_stack_size;
 
 #ifdef __VOLUME_RECORD_ALL__
-  Intersection hits[2 * volume_stack_size + 1];
+  Intersection hits[2 * MAX_VOLUME_STACK_SIZE + 1];
   uint num_hits = scene_intersect_volume_all(
       kg, &volume_ray, hits, 2 * volume_stack_size, PATH_RAY_ALL_VISIBILITY);
   if (num_hits > 0) {
@@ -98,11 +98,11 @@ ccl_device void integrator_intersect_volume_stack(INTEGRATOR_STATE_ARGS)
   const uint volume_stack_size = kernel_data.volume_stack_size;
 
 #ifdef __VOLUME_RECORD_ALL__
-  Intersection hits[2 * volume_stack_size + 1];
+  Intersection hits[2 * MAX_VOLUME_STACK_SIZE + 1];
   uint num_hits = scene_intersect_volume_all(
       kg, &volume_ray, hits, 2 * volume_stack_size, visibility);
   if (num_hits > 0) {
-    int enclosed_volumes[volume_stack_size];
+    int enclosed_volumes[MAX_VOLUME_STACK_SIZE];
     Intersection *isect = hits;
 
     qsort(hits, num_hits, sizeof(Intersection), intersections_compare);



More information about the Bf-blender-cvs mailing list