summaryrefslogtreecommitdiff
path: root/tests/vkray
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vkray')
-rw-r--r--tests/vkray/anyhit.slang11
-rw-r--r--tests/vkray/closesthit.slang35
2 files changed, 24 insertions, 22 deletions
diff --git a/tests/vkray/anyhit.slang b/tests/vkray/anyhit.slang
index 641fa3059..45d35b1fa 100644
--- a/tests/vkray/anyhit.slang
+++ b/tests/vkray/anyhit.slang
@@ -12,6 +12,7 @@ struct SphereHitAttributes
struct ShadowRay
{
float4 hitDistance;
+ float3 dummyOut;
};
struct Params
@@ -42,13 +43,13 @@ void main(
}
uint index = 0U;
- HitTriangleVertexPosition(index);
+ ioPayload.dummyOut = HitTriangleVertexPosition(index);
- index = 1U;
- HitTriangleVertexPosition(index);
+ index = 1U;
+ ioPayload.dummyOut += HitTriangleVertexPosition(index);
- index = 2U;
- HitTriangleVertexPosition(index);
+ index = 2U;
+ ioPayload.dummyOut += HitTriangleVertexPosition(index);
}
// SPIRV-DAG: OpCapability RayTracing
diff --git a/tests/vkray/closesthit.slang b/tests/vkray/closesthit.slang
index 31728abc1..b7d40e5f9 100644
--- a/tests/vkray/closesthit.slang
+++ b/tests/vkray/closesthit.slang
@@ -5,6 +5,7 @@
struct ReflectionRay
{
float4 color;
+ float3 dummyOut;
};
StructuredBuffer<float4> colors;
@@ -12,33 +13,33 @@ StructuredBuffer<float4> colors;
layout(shaderRecordNV)
cbuffer ShaderRecord
{
- uint shaderRecordID;
+ uint shaderRecordID;
}
void main(
- BuiltInTriangleIntersectionAttributes attributes,
- in out ReflectionRay ioPayload)
+ BuiltInTriangleIntersectionAttributes attributes,
+ in out ReflectionRay ioPayload)
{
- uint materialID = (InstanceIndex() << 1)
- + InstanceID()
- + PrimitiveIndex()
- + HitKind()
- + shaderRecordID;
+ uint materialID = (InstanceIndex() << 1)
+ + InstanceID()
+ + PrimitiveIndex()
+ + HitKind()
+ + shaderRecordID;
- float4 color = colors[materialID];
+ float4 color = colors[materialID];
- color *= RayTCurrent() - RayTMin();
+ color *= RayTCurrent() - RayTMin();
- ioPayload.color = color;
+ ioPayload.color = color;
- uint index = 0U;
- HitTriangleVertexPosition(index);
+ uint index = 0U;
+ ioPayload.dummyOut = HitTriangleVertexPosition(index);
- index = 1U;
- HitTriangleVertexPosition(index);
+ index = 1U;
+ ioPayload.dummyOut += HitTriangleVertexPosition(index);
- index = 2U;
- HitTriangleVertexPosition(index);
+ index = 2U;
+ ioPayload.dummyOut += HitTriangleVertexPosition(index);
}
// CHECK: OpCapability RayTracing