-
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.
Allow requiring glsl language extensions on structs (#6173)
* Allow requiring glsl language extensions on structs * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
- Loading branch information
1 parent
a5b1aa0
commit c356d3a
Showing
3 changed files
with
64 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//TEST:SIMPLE(filecheck=CHECK): -target glsl -entry main -stage compute | ||
|
||
RWStructuredBuffer<float> outputBuffer; | ||
|
||
// Check that extensions on types work | ||
__glsl_extension(GL_BAR_bar) | ||
// CHECK-DAG: #extension GL_BAR_bar : require | ||
struct S | ||
{ | ||
float a; | ||
} | ||
|
||
// Check that extensions on functions work | ||
__glsl_extension(GL_FOO_foo) | ||
// CHECK-DAG: #extension GL_FOO_foo : require | ||
float foo(S s) | ||
{ | ||
return s.a; | ||
} | ||
|
||
[numthreads(4, 1, 1)] | ||
void main(uint3 dispatchThreadID : SV_DispatchThreadID) | ||
{ | ||
S s; | ||
s.a = 0; | ||
outputBuffer[dispatchThreadID.x] = foo(s); | ||
} |