Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
csyonghe committed Jan 14, 2025
1 parent e34559e commit a7a1c3c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/cuda/optix-hit-attributes.slang
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit a7a1c3c

Please sign in to comment.