diff options
| author | Alexey Panteleev <alpanteleev@nvidia.com> | 2022-04-06 19:07:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-06 19:07:30 -0700 |
| commit | 86221ff4757ee504307f3537b34acb05117ce272 (patch) | |
| tree | 9f8b6b86cae3cdf2307ff9d3b15feea079525a05 /tests/vkray | |
| parent | 464ecb6083f64f903df19b961e2af0075bdf3111 (diff) | |
Fixed the mapping of the ray tracing instance functions to GLSL (#2177)
* Fixed the mapping of the *InstanceID() and *InstanceIndex() functions to GLSL.
* Fixed and somewhat improved the vkray/closesthit test.
Diffstat (limited to 'tests/vkray')
| -rw-r--r-- | tests/vkray/closesthit.slang | 2 | ||||
| -rw-r--r-- | tests/vkray/closesthit.slang.glsl | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/vkray/closesthit.slang b/tests/vkray/closesthit.slang index 28c759175..b1b73c94e 100644 --- a/tests/vkray/closesthit.slang +++ b/tests/vkray/closesthit.slang @@ -18,7 +18,7 @@ void main( BuiltInTriangleIntersectionAttributes attributes, in out ReflectionRay ioPayload) { - uint materialID = InstanceIndex() + uint materialID = (InstanceIndex() << 1) + InstanceID() + PrimitiveIndex() + HitKind() diff --git a/tests/vkray/closesthit.slang.glsl b/tests/vkray/closesthit.slang.glsl index e3af26a04..b5daef909 100644 --- a/tests/vkray/closesthit.slang.glsl +++ b/tests/vkray/closesthit.slang.glsl @@ -48,10 +48,12 @@ rayPayloadInNV ReflectionRay_0 tmp_payload; void main() { - uint tmp_customidx = gl_InstanceCustomIndexNV; uint tmp_instanceid = gl_InstanceID; + uint tmp_shift_0 = tmp_instanceid << 1; + + uint tmp_customidx = gl_InstanceCustomIndexNV; - uint tmp_add_0 = tmp_customidx + tmp_instanceid; + uint tmp_add_0 = tmp_shift_0 + tmp_customidx; uint tmp_primid = gl_PrimitiveID; uint tmp_add_1 = tmp_add_0 + tmp_primid; |
