-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[HLSL][RootSignature] Implement validation of resource ranges for RootDescriptors
#140962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6ee2563
rebased original version
inbelic 75402c3
review: use sorted RangeInfo as opposed to storing in a densemap
inbelic e7b3ab5
review: fix-up comments
inbelic 7beb3e4
review: spell out types
inbelic 033d342
review: rename Vis to Visibility
inbelic 4f87519
review: remove unrequired MutableArrayRef
inbelic 2f051fa
review: use std::array
inbelic c1bfdd2
review: remove use of defines in test cases
inbelic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
26 changes: 26 additions & 0 deletions
26
clang/test/SemaHLSL/RootSignature-resource-ranges-err.hlsl
This file contains hidden or 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,26 @@ | ||
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - %s -verify | ||
|
||
#define Overlap0 "CBV(b42), CBV(b42)" | ||
|
||
[RootSignature(Overlap0)] // expected-error {{resource ranges b[42;42] and b[42;42] overlap within space = 0 and visibility = All}} | ||
inbelic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void bad_root_signature_0() {} | ||
|
||
#define Overlap1 "SRV(t0, space = 3), SRV(t0, space = 3)" | ||
|
||
[RootSignature(Overlap1)] // expected-error {{resource ranges t[0;0] and t[0;0] overlap within space = 3 and visibility = All}} | ||
void bad_root_signature_1() {} | ||
|
||
#define Overlap2 "UAV(u0, visibility = SHADER_VISIBILITY_PIXEL), UAV(u0, visibility = SHADER_VISIBILITY_PIXEL)" | ||
|
||
[RootSignature(Overlap2)] // expected-error {{resource ranges u[0;0] and u[0;0] overlap within space = 0 and visibility = Pixel}} | ||
void bad_root_signature_2() {} | ||
|
||
#define Overlap3 "UAV(u0, visibility = SHADER_VISIBILITY_ALL), UAV(u0, visibility = SHADER_VISIBILITY_PIXEL)" | ||
|
||
[RootSignature(Overlap3)] // expected-error {{resource ranges u[0;0] and u[0;0] overlap within space = 0 and visibility = Pixel}} | ||
void bad_root_signature_3() {} | ||
|
||
#define Overlap4 "UAV(u0, visibility = SHADER_VISIBILITY_PIXEL), UAV(u0, visibility = SHADER_VISIBILITY_ALL)" | ||
|
||
[RootSignature(Overlap4)] // expected-error {{resource ranges u[0;0] and u[0;0] overlap within space = 0 and visibility = Pixel}} | ||
void bad_root_signature_4() {} |
This file contains hidden or 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,22 @@ | ||
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - %s -verify | ||
// expected-no-diagnostics | ||
|
||
#define NoOverlap0 "CBV(b0), CBV(b1)" | ||
|
||
[RootSignature(NoOverlap0)] | ||
void valid_root_signature_0() {} | ||
|
||
#define NoOverlap1 "CBV(b0, visibility = SHADER_VISIBILITY_DOMAIN), CBV(b0, visibility = SHADER_VISIBILITY_PIXEL)" | ||
|
||
[RootSignature(NoOverlap1)] | ||
void valid_root_signature_1() {} | ||
|
||
#define NoOverlap2 "CBV(b0, space = 1), CBV(b0, space = 2)" | ||
|
||
[RootSignature(NoOverlap2)] | ||
void valid_root_signature_2() {} | ||
|
||
#define NoOverlap3 "CBV(b0), SRV(t0)" | ||
|
||
[RootSignature(NoOverlap3)] | ||
void valid_root_signature_3() {} |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.