-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add verification logic on push and specialization constants.
- Loading branch information
Showing
5 changed files
with
89 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv | ||
|
||
struct T { int x; int y; } | ||
|
||
// CHECK: ([[# @LINE+1]]): error 31218 | ||
[vk::constant_id(1)] | ||
const T st; | ||
|
||
[vk::constant_id(1)] | ||
// CHECK: ([[# @LINE+1]]): error 31219 | ||
static const int x = 2; | ||
|
||
[push_constant] | ||
[vk::constant_id(1)] | ||
// CHECK: ([[# @LINE+1]]): error 31220 | ||
const int y; |
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,18 @@ | ||
// Test that push constants should not occupy the default | ||
// space. | ||
|
||
//TEST:SIMPLE(filecheck=CHECK): -target spirv | ||
|
||
// CHECK-NOT: OpDecorate {{.*}} DescriptorSet 1 | ||
|
||
struct Data { | ||
StructuredBuffer<uint4> data; | ||
RWStructuredBuffer<float> output; | ||
}; | ||
ParameterBlock<Data> gData; | ||
|
||
[numthreads(1,1,1)] | ||
void taskMain(uniform uint a) | ||
{ | ||
gData.output[0] = gData.data[0].x + a; | ||
} |