- Notifications
You must be signed in to change notification settings - Fork 15.1k
[DirectX] Adding missing descriptor table validations #153276
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
joaosaffran merged 178 commits into llvm:main from joaosaffran:validation/descriptor-tables Sep 26, 2025
Merged
Changes from all commits
Commits
Show all changes
178 commits Select commit Hold shift + click to select a range
0e8828c refactoring
2edd215 refactoring
242545e clean up
3f8dec4 format
3b1ce3b formating
f5720af fix import issues
ea54904 formating
a49aa19 refactoring
d90676f init refactoring
a04eb9f adding validation
5994b8f clean
e8b14bf implementing
8f40e83 finish implementing && fix tests
28350b2 fix issue
4fd2e0b sync parent
e25ee87 sync parent
01a558b add validation
881dd36 address comments
8779ee9 Merge branch 'refactoring/updating-return-root-sig-analysis' into val…
43eb04e adding validation
c16f15b fix test
f67bec1 Merge branch 'validation/check-descriptors-are-bound' into validation…
d7b4cf4 format
c7d5be7 format
cc5afae address changes
571a0ef fix tests
974d4bc Merge branch 'refactoring/updating-return-root-sig-analysis' into val…
403b546 Merge branch 'validation/check-descriptors-are-bound' into validation…
aea75da fix test
e0bc862 add preserved
b5a0b32 addressing comments
00a74af Merge branch 'main' into validation/check-descriptors-are-bound
5ccb842 updating
5423aba format
a7637a7 adding tests
da42c0c clean up
5af9199 update
46294cb Merge branch 'validation/check-descriptors-are-bound' into validation…
91ff1bf clean up
edb015d address comments
5f8bbeb Merge branch 'validation/check-descriptors-are-bound' into validation…
9f3888e adding root constants
8459d14 Merge branch 'validation/check-descriptors-are-bound' into validation…
578a03b clean
34deb3a Merge branch 'validation/check-descriptors-are-bound' into validation…
b4a0e16 moving code arround
49f3bf2 Merge branch 'validation/check-descriptors-are-bound' into validation…
ef14638 clean
662c3a8 addressing comments
848501d address comments
8d97116 format test
9c34f3f fix test
24040a0 Merge branch 'validation/check-descriptors-are-bound' into validation…
2c30cd9 addressing comments
260633c address comments
d42f156 Merge branch 'main' into validation/check-descriptors-are-bound
9ee3a4b Merge branch 'main' into validation/check-descriptors-are-bound
6db6224 update code
04658b8 cleanup
adf3feb address comments from inbelic
c95ce68 refactoring
af6aa53 add tests
29eb893 cleanup
ed4c553 clean
28fb609 clean up
fc338b5 Merge branch 'validation/overlapping-ranges' into validation/check-de…
f5b5b3e clean
03d571a clean?
76048d4 Merge branch 'validation/check-descriptors-are-bound' into validation…
7c9bd62 clean?
ef51048 format
21675e6 formating
849ff86 format
7a1bc21 format
403972d addressing comments from bogner and inbelic
joaosaffran-zz 0f0435d clean up
joaosaffran-zz e841a98 clean up
joaosaffran-zz ae6d67a fix build
joaosaffran-zz 41f32bd fix tests
joaosaffran-zz 47662f0 Merge branch 'validation/overlapping-ranges' into validation/check-de…
6da5fb0 format
108a7d5 Merge branch 'validation/check-descriptors-are-bound' into validation…
6f3d019 Merge branch 'main' into validation/overlapping-ranges
971ad57 Merge branch 'main' into validation/overlapping-ranges
db73d71 update
3b04c2d address comment from inbelic
1ddffc3 address comments 2
1c10acf fix merge mess
50e78d2 check if table mix samplers with others
aee4c56 validating register not overflow in table
7d1c13e clean
85719af format
cc304fd format
3c28142 fix typo
81261ff clean
db0008e addressing comments from inbelic
0c72dcf addressing inbelic comments
b4e5fb4 adding test
e5e73fe address comments
ad0e1f3 address comments
d97eb7c Merge branch 'validation/descriptor-tables' of https://github.com/joa…
8a4ee3c fix comment
4a655a5 addressing comments from bogner
cc94561 addressing comments
98f48d2 address comments
eb334b8 refactoring
06c0da4 addressing comments
d58606f Merge branch 'main' into validation/overlapping-ranges
74980c8 fix test
23537b5 addressing comment
d376abf address comments
4abb40d Merge branch 'validation/overlapping-ranges' into validation/check-de…
bb44eef fix test
1cf2d1e Merge branch 'main' into validation/check-descriptors-are-bound
373d871 clean up
d2750d7 format
777d544 Merge branch 'validation/check-descriptors-are-bound' into validation…
19e9baa fix merge oopsi
708c4dc format
a163d1b clean up
4f120cc clean up tests
def929f Merge
d3349ce clean up
bf5714d moving code to where I think make sense
7cf513f format
fe24637 format
6db8d93 refactoring to not create extra space
joaosaffran e3a65b6 remove copy of binding
joaosaffran e902add making BindingRange const
joaosaffran 9a6d64c doing it again for other isBound
joaosaffran 15b7592 adding DXILResourceTypeMap
joaosaffran 11b9fb2 updating error messages and tests
joaosaffran 0b8a997 Merge branch 'validation/check-descriptors-are-bound' into validation…
joaosaffran 34619da moving offset logic into shared validations
joaosaffran 84d4579 refactoring suggested by inbelic
joaosaffran d2b4aea adding multiple error messages
joaosaffran e2ba167 removing StartSlot
joaosaffran b395a47 removing unecessary code
joaosaffran 17b425d Merge branch 'main' into validation/textures-not-bind-root-signatures
joaosaffran f9c4b9c refactoring
joaosaffran c7cedb4 adding comment
joaosaffran bf9b30c refactoring isBound to return the bound reg
joaosaffran 18e4c3d formating
joaosaffran 567bd15 Merge branch 'validation/textures-not-bind-root-signatures' into vali…
joaosaffran 42518b2 clean up
joaosaffran f6abbf7 clean up
joaosaffran 2971f5f clean up
joaosaffran f0ed242 clean up: self review
joaosaffran a6a9fe9 clean up self review
joaosaffran 3f83308 remove optional from type
joaosaffran 8daa97b changing small string size
joaosaffran 79f1f48 fixing tests
joaosaffran 3d10d92 removing type from handlefrombinding
joaosaffran f596ad5 Merge branch 'main' into validation/textures-not-bind-root-signatures
joaosaffran 55c2b96 renamig tests
joaosaffran d1c31f1 Merge branch 'validation/textures-not-bind-root-signatures' of https:…
joaosaffran 75d74ed Merge branch 'validation/textures-not-bind-root-signatures' into vali…
joaosaffran fbf6776 refactoring to use existing funcs
joaosaffran 5f429d2 Merge branch 'main' into validation/descriptor-tables
joaosaffran 5633433 clean up
joaosaffran ec10db8 Merge branch 'validation/descriptor-tables' of https://github.com/joa…
joaosaffran b42630a clean up
joaosaffran bce1ef9 improve comment message
joaosaffran cf84fcf clean up
joaosaffran e5976ee making updateOngoingOffset shared
joaosaffran eb84e14 refactoring
joaosaffran 6a3c2ab formating
joaosaffran 1327b74 Merge branch 'main' into validation/descriptor-tables
joaosaffran c2d39ed addressing comments from bogner
joaosaffran 592dc62 adding edge case test
joaosaffran f3253ed changing frontend check back to what it was
joaosaffran d442625 removing some copies
joaosaffran f785d25 adding same test as frontend
joaosaffran eefd22c refactor to copy frontend
0c508d8 Merge branch 'main' into validation/descriptor-tables
b188df1 fix test and change error message
dabb9cd format
joaosaffran 0e08cea format
joaosaffran 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
Some comments aren't visible on the classic Files Changed page.
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
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
16 changes: 16 additions & 0 deletions 16 llvm/test/CodeGen/DirectX/rootsignature-validation-appending-limits.ll
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,16 @@ | ||
| ; RUN: opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s | ||
| ; A descriptor range can be placed at UINT_MAX, matching DXC's behaviour | ||
| ; CHECK-NOT: error: | ||
| | ||
| define void @CSMain() "hlsl.shader"="compute" { | ||
| entry: | ||
| ret void | ||
| } | ||
| | ||
| !dx.rootsignatures = !{!0} | ||
| | ||
| !0 = !{ptr @CSMain, !1, i32 2} | ||
| !1 = !{!3} | ||
| !3 = !{!"DescriptorTable", i32 0, !4, !5} | ||
| !4 = !{!"UAV", i32 1, i32 1, i32 0, i32 4294967294, i32 0} | ||
| !5 = !{!"UAV", i32 1, i32 0, i32 0, i32 -1, i32 0} |
16 changes: 16 additions & 0 deletions 16 llvm/test/CodeGen/DirectX/rootsignature-validation-fail-appending-limits-multiples.ll
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,16 @@ | ||
| ; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s | ||
| ; CHECK: error: Offset overflow for descriptor range: CBV(register=2, space=0). | ||
| | ||
| define void @CSMain() "hlsl.shader"="compute" { | ||
| entry: | ||
| ret void | ||
| } | ||
| | ||
| !dx.rootsignatures = !{!0} | ||
| | ||
| !0 = !{ptr @CSMain, !1, i32 2} | ||
| !1 = !{!3} | ||
| !3 = !{!"DescriptorTable", i32 0, !4, !5, !6} | ||
| !4 = !{!"CBV", i32 1, i32 0, i32 0, i32 4294967294, i32 0} | ||
| !5 = !{!"CBV", i32 1, i32 1, i32 0, i32 -1, i32 0} | ||
| !6 = !{!"CBV", i32 1, i32 2, i32 0, i32 -1, i32 0} |
17 changes: 17 additions & 0 deletions 17 llvm/test/CodeGen/DirectX/rootsignature-validation-fail-appending-overflow.ll
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,17 @@ | ||
| ; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s | ||
| ; This test checks if a resource is implicitly overflowing. That means, it is appending a resource after an unbounded range. | ||
| | ||
| ; CHECK: error: Range UAV(register=0, space=0) cannot be appended after an unbounded range | ||
| | ||
| define void @CSMain() "hlsl.shader"="compute" { | ||
| entry: | ||
| ret void | ||
| } | ||
| | ||
| !dx.rootsignatures = !{!0} | ||
| | ||
| !0 = !{ptr @CSMain, !1, i32 2} | ||
| !1 = !{!3} | ||
| !3 = !{!"DescriptorTable", i32 0, !4, !5} | ||
| !4 = !{!"UAV", i32 -1, i32 1, i32 0, i32 2, i32 0} | ||
| !5 = !{!"UAV", i32 1, i32 0, i32 0, i32 -1, i32 0} |
15 changes: 15 additions & 0 deletions 15 llvm/test/CodeGen/DirectX/rootsignature-validation-fail-offset-overflow.ll
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,15 @@ | ||
| ; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s | ||
| ; CHECK: error: Offset overflow for descriptor range: UAV(register=0, space=0). | ||
| | ||
| define void @CSMain() "hlsl.shader"="compute" { | ||
| entry: | ||
| ret void | ||
| } | ||
| | ||
| !dx.rootsignatures = !{!0} | ||
| | ||
| !0 = !{ptr @CSMain, !1, i32 2} | ||
| !1 = !{!3} | ||
| !3 = !{!"DescriptorTable", i32 0, !4, !5} | ||
| !4 = !{!"UAV", i32 100, i32 0, i32 0, i32 4294967294, i32 0} | ||
| !5 = !{!"UAV", i32 1, i32 101, i32 0, i32 10, i32 0} |
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.