Skip to content

Commit cd6b9f0

Browse files
author
kevyuu
committed
Add comment referring to microsoft/DirectXShaderCompiler#7279 as the reason we don't use spirv intrinsics for ignoreIntersection and terminateRay
1 parent 052158c commit cd6b9f0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

71_RayTracingPipeline/app_resources/raytrace.rahit.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ void main(inout PrimaryPayload payload, in BuiltInTriangleIntersectionAttributes
1313
const STriangleGeomInfo geom = vk::RawBufferLoad < STriangleGeomInfo > (pc.triangleGeomInfoBuffer + instID * sizeof(STriangleGeomInfo));
1414

1515
const uint32_t bitpattern = payload.pcg();
16+
// Cannot use spirv::ignoreIntersectionKHR and spirv::terminateRayKHR due to https://github.com/microsoft/DirectXShaderCompiler/issues/7279
1617
if (geom.material.alphaTest(bitpattern))
1718
IgnoreHit();
1819
}

71_RayTracingPipeline/app_resources/raytrace_shadow.rahit.hlsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ void main(inout OcclusionPayload payload, in BuiltInTriangleIntersectionAttribut
1616
const float attenuation = (1.f-material.alpha) * payload.attenuation;
1717
// DXC cogegens weird things in the presence of termination instructions
1818
payload.attenuation = attenuation;
19+
20+
21+
// Cannot use spirv::ignoreIntersectionKHR and spirv::terminateRayKHR due to https://github.com/microsoft/DirectXShaderCompiler/issues/7279
1922
// arbitrary constant, whatever you want the smallest attenuation to be. Remember until miss, the attenuatio is negative
2023
if (attenuation > -1.f/1024.f)
2124
AcceptHitAndEndSearch();

0 commit comments

Comments
 (0)