-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
HL Intrinsic functions share declarations with those that match group and function signature, regardless of the original intrinsic name. This means that intrinsics with differing attributes can be collapsed into the same HL functions, leading to incorrect attributes for some HL intrinsics. This fixes this issue by adding the attributes to the HL operation mangling, the same way this issue was fixed for the HLWaveSensitive attribute before. Fixes #3505 --------- Co-authored-by: Joshua Batista <[email protected]> (cherry picked from commit d9c07e9) Co-authored-by: Tex Riddell <[email protected]>
- Loading branch information
Showing
8 changed files
with
299 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tools/clang/test/HLSLFileCheck/hlsl/objects/RayQuery/intrinsicAttributeCollision.hlsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// RUN: %dxc -T cs_6_5 -E CS -fcgl %s | FileCheck %s | ||
// RUN: %dxc -T cs_6_5 -E CS %s | FileCheck %s -check-prefix=CHECKDXIL | ||
|
||
// Proceed called before CommittedTriangleFrontFace. | ||
// Don't be sensitive to HL Opcode because those can change. | ||
// CHECK: call i1 [[HLProceed:@"[^"]+"]](i32 | ||
// CHECK: call i1 [[HLCommittedTriangleFrontFace:@"[^".]+\.[^.]+\.[^.]+\.ro[^"]+"]](i32 | ||
// ^ matches call i1 @"dx.hl.op.ro.i1 (i32, %\22class.RayQuery<5>\22*)"(i32 | ||
// CHECK-LABEL: ret void, | ||
|
||
// Ensure HL declarations are not collapsed when attributes differ | ||
// CHECK-DAG: declare i1 [[HLProceed]]({{.*}}) #[[AttrProceed:[0-9]+]] | ||
// CHECK-DAG: declare i1 [[HLCommittedTriangleFrontFace]]({{.*}}) #[[AttrCommittedTriangleFrontFace:[0-9]+]] | ||
|
||
// Ensure correct attributes for each HL intrinsic | ||
// CHECK-DAG: attributes #[[AttrProceed]] = { nounwind } | ||
// CHECK-DAG: attributes #[[AttrCommittedTriangleFrontFace]] = { nounwind readonly } | ||
|
||
// Ensure Proceed not eliminated in final DXIL: | ||
// CHECKDXIL: call i1 @dx.op.rayQuery_Proceed.i1(i32 180, | ||
// CHECKDXIL: call i1 @dx.op.rayQuery_StateScalar.i1(i32 192, | ||
|
||
RaytracingAccelerationStructure AccelerationStructure : register(t0); | ||
RWByteAddressBuffer log : register(u0); | ||
|
||
[numThreads(1,1,1)] | ||
void CS() | ||
{ | ||
RayQuery<RAY_FLAG_FORCE_OPAQUE|RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH> q; | ||
RayDesc ray = { {0.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0.0f, 9999.0f}; | ||
q.TraceRayInline(AccelerationStructure, RAY_FLAG_NONE, 0xFF, ray); | ||
|
||
q.Proceed(); | ||
|
||
if(q.CommittedTriangleFrontFace()) | ||
{ | ||
log.Store(0,1); | ||
} | ||
} |
Oops, something went wrong.