summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/vkray/closesthit.slang9
-rw-r--r--tests/vkray/closesthit.slang.glsl8
2 files changed, 15 insertions, 2 deletions
diff --git a/tests/vkray/closesthit.slang b/tests/vkray/closesthit.slang
index 12f2dcd4a..419c22a46 100644
--- a/tests/vkray/closesthit.slang
+++ b/tests/vkray/closesthit.slang
@@ -8,6 +8,12 @@ struct ReflectionRay
StructuredBuffer<float4> colors;
+layout(shaderRecordNV)
+cbuffer ShaderRecord
+{
+ uint shaderRecordID;
+}
+
void main(
BuiltInTriangleIntersectionAttributes attributes,
in out ReflectionRay ioPayload)
@@ -15,7 +21,8 @@ void main(
uint materialID = InstanceIndex()
+ InstanceID()
+ PrimitiveIndex()
- + HitKind();
+ + HitKind()
+ + shaderRecordID;
float4 color = colors[materialID];
diff --git a/tests/vkray/closesthit.slang.glsl b/tests/vkray/closesthit.slang.glsl
index ef969ee1c..a056b7809 100644
--- a/tests/vkray/closesthit.slang.glsl
+++ b/tests/vkray/closesthit.slang.glsl
@@ -2,6 +2,12 @@
#version 460
#extension GL_NV_ray_tracing : require
+layout(shaderRecordNV)
+buffer ShaderRecord_0
+{
+ uint shaderRecordID_0;
+};
+
layout(std430, binding = 0) buffer _S1
{
vec4 colors_0[];
@@ -34,7 +40,7 @@ void main()
uint _S9 = _S7 + _S8;
uint _S10 = gl_HitKindNV;
- vec4 color_1 = colors_0[_S9 + _S10];
+ vec4 color_1 = colors_0[_S9 + _S10 + shaderRecordID_0];
float _S11 = gl_HitTNV;
float _S12 = gl_RayTminNV;