diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-10-06 17:49:20 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-10-06 17:51:07 +0300 |
commit | 0194e54fd3276a722ea5c2a8cdff6486c30dcbad (patch) | |
tree | b9ebb585cc71ee362dedfbcb045e7086d376c7ab | |
parent | 75fbf6f17e69ee9c6487173ae5957cfff5193d1f (diff) |
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.
-rw-r--r-- | intern/cycles/kernel/integrator/integrator_intersect_volume_stack.h | 6 |
1 files changed, 3 insertions, 3 deletions
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); |