summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-01-15 15:49:29 -0800
committerGitHub <noreply@github.com>2025-01-15 15:49:29 -0800
commitd9d0b4f03277027690a909a76b78d1622ac13498 (patch)
tree871c2588db2aab54b220a6daa35e87a1ea14697e /tests
parentcb835b9596f78771dfd584aaa72aee7bc360b3d4 (diff)
Fix optix varying legalization. (#6089)
* Fix optix varying legalization. * Add test.
Diffstat (limited to 'tests')
-rw-r--r--tests/cuda/optix-hit-attributes.slang15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/cuda/optix-hit-attributes.slang b/tests/cuda/optix-hit-attributes.slang
new file mode 100644
index 000000000..347401893
--- /dev/null
+++ b/tests/cuda/optix-hit-attributes.slang
@@ -0,0 +1,15 @@
+//TEST:SIMPLE(filecheck=CHECK): -target cuda
+//CHECK: __global__ void __closesthit__closestHitShaderA
+struct RayPayload
+{
+ float4 color;
+};
+
+[shader("closesthit")]
+void closestHitShaderA(inout RayPayload payload, in BuiltInTriangleIntersectionAttributes attr)
+{
+ uint primitiveIndex = PrimitiveIndex();
+ float4 color = float4(0, 0, 0, 1);
+ color[primitiveIndex] = 1;
+ payload.color = color;
+}