-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[DirectX] Validate if Textures/TypedBuffers are being bound in Root Signatures #147573
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
Changes from 128 commits
0e8828c
2edd215
242545e
3f8dec4
3b1ce3b
f5720af
ea54904
a49aa19
d90676f
a04eb9f
5994b8f
e8b14bf
8f40e83
28350b2
4fd2e0b
e25ee87
01a558b
881dd36
8779ee9
43eb04e
c16f15b
f67bec1
d7b4cf4
c7d5be7
cc5afae
571a0ef
974d4bc
403b546
aea75da
e0bc862
b5a0b32
00a74af
5ccb842
5423aba
a7637a7
da42c0c
5af9199
46294cb
91ff1bf
edb015d
5f8bbeb
9f3888e
8459d14
578a03b
34deb3a
b4a0e16
49f3bf2
ef14638
662c3a8
848501d
8d97116
9c34f3f
24040a0
2c30cd9
260633c
d42f156
9ee3a4b
6db6224
04658b8
adf3feb
c95ce68
af6aa53
29eb893
ed4c553
28fb609
fc338b5
f5b5b3e
03d571a
76048d4
7c9bd62
ef51048
21675e6
849ff86
7a1bc21
403972d
0f0435d
e841a98
ae6d67a
41f32bd
47662f0
6da5fb0
108a7d5
6f3d019
971ad57
db73d71
3b04c2d
1ddffc3
1c10acf
db0008e
0c72dcf
b4e5fb4
4a655a5
cc94561
98f48d2
eb334b8
06c0da4
d58606f
74980c8
d376abf
4abb40d
bb44eef
1cf2d1e
373d871
d2750d7
777d544
19e9baa
708c4dc
a163d1b
4f120cc
7cf513f
fe24637
6db8d93
e3a65b6
e902add
9a6d64c
15b7592
11b9fb2
0b8a997
17b425d
f9c4b9c
c7cedb4
bf9b30c
18e4c3d
3f83308
8daa97b
79f1f48
3d10d92
f596ad5
55c2b96
d1c31f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s | ||
; "This is a valid root signature with a texture/typed buffer resource" | ||
|
||
@TB.str = private unnamed_addr constant [3 x i8] c"TB\00", align 1 | ||
|
||
define void @CSMain() "hlsl.shader"="compute" { | ||
entry: | ||
%TB = tail call target("dx.Texture", <4 x float>, 1, 0, 0, 4) @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr nonnull @TB.str) | ||
ret void | ||
} | ||
|
||
!dx.rootsignatures = !{!0} | ||
|
||
!0 = !{ptr @CSMain, !1, i32 2} | ||
!1 = !{!3} | ||
!3 = !{!"DescriptorTable", i32 0, !4} | ||
!4 = !{!"UAV", i32 1, i32 0, i32 0, i32 -1, i32 0} |
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: UAV at register 0 and space 0 is bound to a texture or typed buffer. | ||
|
||
@TB.str = private unnamed_addr constant [3 x i8] c"TB\00", align 1 | ||
|
||
define void @CSMain() "hlsl.shader"="compute" { | ||
entry: | ||
%TB = tail call target("dx.Texture", float, 1, 0, 0, 4) @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr nonnull @TB.str) | ||
ret void | ||
} | ||
|
||
!dx.rootsignatures = !{!0} | ||
|
||
!0 = !{ptr @CSMain, !1, i32 2} | ||
!1 = !{!2} | ||
!2 = !{!"RootUAV", i32 0, i32 0, i32 0, i32 4} |
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: UAV at register 0 and space 0 is bound to a texture or typed buffer. | ||
|
||
@TB.str = private unnamed_addr constant [3 x i8] c"TB\00", align 1 | ||
|
||
define void @CSMain() "hlsl.shader"="compute" { | ||
entry: | ||
%TB = tail call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr nonnull @TB.str) | ||
ret void | ||
} | ||
|
||
!dx.rootsignatures = !{!0} | ||
|
||
!0 = !{ptr @CSMain, !1, i32 2} | ||
!1 = !{!2} | ||
!2 = !{!"RootUAV", i32 0, i32 0, i32 0, i32 4} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should rename this test to match the new name on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, missed this one |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | ||
; This is a valid root signature with a texture/typed buffer resource | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as previous valid test |
||
|
||
@TB.str = private unnamed_addr constant [3 x i8] c"TB\00", align 1 | ||
|
||
define void @CSMain() "hlsl.shader"="compute" { | ||
entry: | ||
%TB = tail call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding(i32 0, i32 0, i32 1, i32 0, ptr nonnull @TB.str) | ||
ret void | ||
} | ||
|
||
!dx.rootsignatures = !{!0} | ||
|
||
!0 = !{ptr @CSMain, !1, i32 2} | ||
!1 = !{!3} | ||
!3 = !{!"DescriptorTable", i32 0, !4} | ||
!4 = !{!"UAV", i32 1, i32 0, i32 0, i32 -1, i32 0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last sentence added to match DXC diagnostic message