diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh_shadow.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh_subsurface.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh_traversal.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_bvh_volume.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_qbvh_shadow.h | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_qbvh_subsurface.h | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_qbvh_traversal.h | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/geom/geom_qbvh_volume.h | 8 |
8 files changed, 40 insertions, 0 deletions
diff --git a/intern/cycles/kernel/geom/geom_bvh_shadow.h b/intern/cycles/kernel/geom/geom_bvh_shadow.h index dd3a1709bbb..6dafd2c9fdc 100644 --- a/intern/cycles/kernel/geom/geom_bvh_shadow.h +++ b/intern/cycles/kernel/geom/geom_bvh_shadow.h @@ -182,6 +182,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, } ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = nodeAddrChild1; } else { @@ -317,6 +318,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, #endif ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = ENTRYPOINT_SENTINEL; nodeAddr = kernel_tex_fetch(__object_node, object); diff --git a/intern/cycles/kernel/geom/geom_bvh_subsurface.h b/intern/cycles/kernel/geom/geom_bvh_subsurface.h index 974e0e47e12..ea9d7c07a72 100644 --- a/intern/cycles/kernel/geom/geom_bvh_subsurface.h +++ b/intern/cycles/kernel/geom/geom_bvh_subsurface.h @@ -169,6 +169,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, } ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = nodeAddrChild1; } else { @@ -250,6 +251,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, #endif ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = ENTRYPOINT_SENTINEL; nodeAddr = kernel_tex_fetch(__object_node, object); diff --git a/intern/cycles/kernel/geom/geom_bvh_traversal.h b/intern/cycles/kernel/geom/geom_bvh_traversal.h index 7cbb1bece55..b948ab8f5e4 100644 --- a/intern/cycles/kernel/geom/geom_bvh_traversal.h +++ b/intern/cycles/kernel/geom/geom_bvh_traversal.h @@ -226,6 +226,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, } ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = nodeAddrChild1; } else { @@ -334,6 +335,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, #endif ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = ENTRYPOINT_SENTINEL; nodeAddr = kernel_tex_fetch(__object_node, object); diff --git a/intern/cycles/kernel/geom/geom_bvh_volume.h b/intern/cycles/kernel/geom/geom_bvh_volume.h index 152aa957277..f1f2e6d1f46 100644 --- a/intern/cycles/kernel/geom/geom_bvh_volume.h +++ b/intern/cycles/kernel/geom/geom_bvh_volume.h @@ -170,6 +170,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, } ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = nodeAddrChild1; } else { @@ -266,6 +267,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, #endif ++stackPtr; + kernel_assert(stackPtr < BVH_STACK_SIZE); traversalStack[stackPtr] = ENTRYPOINT_SENTINEL; nodeAddr = kernel_tex_fetch(__object_node, object); diff --git a/intern/cycles/kernel/geom/geom_qbvh_shadow.h b/intern/cycles/kernel/geom/geom_qbvh_shadow.h index 57c799ccd4f..e493a3f51bd 100644 --- a/intern/cycles/kernel/geom/geom_qbvh_shadow.h +++ b/intern/cycles/kernel/geom/geom_qbvh_shadow.h @@ -128,6 +128,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, if(d1 < d0) { nodeAddr = c1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = d0; continue; @@ -135,6 +136,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, else { nodeAddr = c0; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = d1; continue; @@ -145,9 +147,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, * all nodes onto the stack to sort them there. */ ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = c1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = c0; @@ -159,6 +163,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, float d2 = ((float*)&dist)[r]; if(traverseChild == 0) { ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -176,9 +181,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c3; traversalStack[stackPtr].dist = d3; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -323,6 +330,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, triangle_intersect_precalc(dir, &isect_precalc); ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = ENTRYPOINT_SENTINEL; nodeAddr = kernel_tex_fetch(__object_node, object); diff --git a/intern/cycles/kernel/geom/geom_qbvh_subsurface.h b/intern/cycles/kernel/geom/geom_qbvh_subsurface.h index 89b582557fe..0154772988f 100644 --- a/intern/cycles/kernel/geom/geom_qbvh_subsurface.h +++ b/intern/cycles/kernel/geom/geom_qbvh_subsurface.h @@ -124,6 +124,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, if(d1 < d0) { nodeAddr = c1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = d0; continue; @@ -131,6 +132,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, else { nodeAddr = c0; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = d1; continue; @@ -141,9 +143,11 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, * all nodes onto the stack to sort them there. */ ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = d1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = d0; @@ -155,6 +159,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, float d2 = ((float*)&dist)[r]; if(traverseChild == 0) { ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -172,9 +177,11 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c3; traversalStack[stackPtr].dist = d3; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -255,6 +262,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, triangle_intersect_precalc(dir, &isect_precalc); ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = ENTRYPOINT_SENTINEL; nodeAddr = kernel_tex_fetch(__object_node, object); diff --git a/intern/cycles/kernel/geom/geom_qbvh_traversal.h b/intern/cycles/kernel/geom/geom_qbvh_traversal.h index efa519fbe3e..5a8bd2298ce 100644 --- a/intern/cycles/kernel/geom/geom_qbvh_traversal.h +++ b/intern/cycles/kernel/geom/geom_qbvh_traversal.h @@ -180,6 +180,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, if(d1 < d0) { nodeAddr = c1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = d0; continue; @@ -187,6 +188,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, else { nodeAddr = c0; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = d1; continue; @@ -197,9 +199,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, * all nodes onto the stack to sort them there. */ ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = d1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = d0; @@ -211,6 +215,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, float d2 = ((float*)&dist)[r]; if(traverseChild == 0) { ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -229,9 +234,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c3; traversalStack[stackPtr].dist = d3; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -345,6 +352,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, triangle_intersect_precalc(dir, &isect_precalc); ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = ENTRYPOINT_SENTINEL; traversalStack[stackPtr].dist = -FLT_MAX; diff --git a/intern/cycles/kernel/geom/geom_qbvh_volume.h b/intern/cycles/kernel/geom/geom_qbvh_volume.h index 00eaa1761a1..9e6e7552b3f 100644 --- a/intern/cycles/kernel/geom/geom_qbvh_volume.h +++ b/intern/cycles/kernel/geom/geom_qbvh_volume.h @@ -130,6 +130,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, if(d1 < d0) { nodeAddr = c1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = d0; continue; @@ -137,6 +138,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, else { nodeAddr = c0; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = d1; continue; @@ -147,9 +149,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, * all nodes onto the stack to sort them there. */ ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c1; traversalStack[stackPtr].dist = d1; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c0; traversalStack[stackPtr].dist = d0; @@ -161,6 +165,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, float d2 = ((float*)&dist)[r]; if(traverseChild == 0) { ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -178,9 +183,11 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, int c3 = __float_as_int(cnodes[r]); float d3 = ((float*)&dist)[r]; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c3; traversalStack[stackPtr].dist = d3; ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = c2; traversalStack[stackPtr].dist = d2; qbvh_stack_sort(&traversalStack[stackPtr], @@ -275,6 +282,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, triangle_intersect_precalc(dir, &isect_precalc); ++stackPtr; + kernel_assert(stackPtr < BVH_QSTACK_SIZE); traversalStack[stackPtr].addr = ENTRYPOINT_SENTINEL; nodeAddr = kernel_tex_fetch(__object_node, object); |