-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extra test for push constant pointers (#301)
- Loading branch information
1 parent
7b89953
commit c637858
Showing
4 changed files
with
671 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
RWStructuredBuffer<uint> result; | ||
|
||
struct Foo{ | ||
uint s; | ||
uint t; | ||
}; | ||
|
||
struct Bar{ | ||
uint x_unused; | ||
uint y; | ||
}; | ||
|
||
struct Data{ | ||
uint a_unused; | ||
uint b[4]; | ||
uint c; | ||
uint d_unused[4]; | ||
Foo* foo_unused; | ||
Bar* bar; | ||
}; | ||
[[vk::push_constant]] Data pc; | ||
|
||
[shader("compute")] | ||
[numthreads(1,1,1)] | ||
void computeMain(uint3 threadId : SV_DispatchThreadID) | ||
{ | ||
result[0] += pc.c; | ||
result[0] += pc.b[1]; | ||
result[0] += pc.bar->y; | ||
} |
Binary file not shown.
Oops, something went wrong.