From 9d40ce4e8921ef468281c91f052dbd443ecf56e2 Mon Sep 17 00:00:00 2001 From: cheneym2 Date: Thu, 19 Sep 2024 16:02:49 -0400 Subject: Update spirv-tools version (#5089) * Update spirv-headers and spirv-tools versions * Fix compute-derivative regressions with upgraded spirv headers Extension was promoted from NV to KHR while retaining same enums. Fixes #5106 * Prevent DCE on ray trace position fetch Adds dummy usage to the intersection positions fetched from HitTriangleVertexPositions to prevent DCE from removing their usage. Fixes #5105 * Update spirv-tools-generated * More DerivativeGroup*KHR test fixes Add fixes for a missing test intrinsic-derivative-function-in-compute.slang Use the {{NV|KHR}} syntax to tolerate either enum. Fixes #5106 * Squash tabs in closesthit test * HACK test CI * Avoid multiple IncomingRayPayloadKHR storage params * Revert "HACK test CI" This reverts commit c2556ea2baef0bd48e4c86f90cf17dfab80015c1. * Avoid multiple IncomingRayPayloadKHR storage params in anyhit --- tests/vkray/anyhit.slang | 11 ++++++----- tests/vkray/closesthit.slang | 35 ++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 22 deletions(-) (limited to 'tests/vkray') 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 colors; @@ -12,33 +13,33 @@ StructuredBuffer 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 -- cgit v1.2.3