-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit missing atomic64 capability, fix int-typed builtin used in both …
…vs and fs.
- Loading branch information
Showing
3 changed files
with
66 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//TEST:SIMPLE(filecheck=CHECK):-target spirv | ||
|
||
// CHECK: OpCapability Int64Atomics | ||
|
||
groupshared Atomic<uint64_t> atomicVariable; | ||
|
||
[shader("compute")] | ||
[numthreads(1, 1, 1)] | ||
void main(uint3 threadId : SV_DispatchThreadID) | ||
{ | ||
uint64_t value = 4ll; | ||
atomicVariable.store(value); | ||
} |
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,19 @@ | ||
//TEST:SIMPLE(filecheck=CHECK): -target spirv | ||
|
||
// ViewIndex builtin should be declared twice, once for vertex and once for fragment shader. | ||
// Because the fragment shader builtin needs Flat, and vertex shader does not. | ||
|
||
// CHECK: OpDecorate %{{.*}} BuiltIn ViewIndex | ||
// CHECK: OpDecorate %{{.*}} BuiltIn ViewIndex | ||
|
||
[shader("vertex")] | ||
float4 vert(int _viewportIndex : SV_ViewID):SV_Position | ||
{ | ||
return float4(_viewportIndex); | ||
} | ||
|
||
[shader("fragment")] | ||
float4 frag(int _viewportIndex : SV_ViewID) : SV_Target | ||
{ | ||
return float4(_viewportIndex, 0, 0, 1); | ||
} |