summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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;
+}