summaryrefslogtreecommitdiffstats
path: root/tests/cuda
diff options
context:
space:
mode:
authorHarsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com>2025-05-26 23:52:45 +0530
committerGitHub <noreply@github.com>2025-05-26 18:22:45 +0000
commit5280ca81025d42239fec492eb72d38606308751a (patch)
tree170da146e2ad7ac421798da12472c053f2333ea3 /tests/cuda
parent83538e0b4b97425ecdae6f72f9c8fd44cb255aac (diff)
Fix operator precedence in OptiX ray payload pointer casting which broke due to (#6326) (#7194)
* Fix operator precedence in OptiX ray payload pointer casting Added extra parentheses around the cast to ensure proper operator precedence when dereferencing the OptiX ray payload pointer. This fixes the issue where the compiler was treating the expression as (RayPayload_0 *)getOptiXRayPayloadPtr()->color_0 instead of ((RayPayload_0 *)getOptiXRayPayloadPtr())->color_0. Error: nvrtc 12.9: tests/cuda/optix-cluster.slang(17): error : expression must have pointer-to-class type but it has type "void *" nvrtc 12.9: note : (RayPayload_0 *)getOptiXRayPayloadPtr()->color_0 = color_1; nvrtc 12.9: note : ^ Tested using: ./build/Debug/bin/slangc -target ptx -Xnvrtc -I"/home/haaggarwal/NVIDIA-OptiX-SDK-9.0.0-linux64-x86_64/include" -DSLANG_CUDA_ENABLE_OPTIX -entry closestHitShaderA ./tests/cuda/optix-cluster.slang * Fix Check
Diffstat (limited to 'tests/cuda')
-rw-r--r--tests/cuda/optix-ignore-hit.slang2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/cuda/optix-ignore-hit.slang b/tests/cuda/optix-ignore-hit.slang
index 8bb128ae0..54cc301bb 100644
--- a/tests/cuda/optix-ignore-hit.slang
+++ b/tests/cuda/optix-ignore-hit.slang
@@ -1,6 +1,6 @@
// optix-ignore-hit.slang
//TEST:SIMPLE(filecheck=CHECK): -target cuda -entry anyHitShader
-//CHECK: HitBuffer_insert_0((HitBuffer_0 *)getOptiXRayPayloadPtr(), hit_0.t_0);
+//CHECK: HitBuffer_insert_0(((HitBuffer_0 *)getOptiXRayPayloadPtr()), hit_0.t_0);
//CHECK: optixIgnoreIntersection