-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2439 from KhronosGroup/fix-2261
MSL: Add option to auto-disable rasterization based on Position usage
- Loading branch information
Showing
12 changed files
with
116 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
25 changes: 25 additions & 0 deletions
25
reference/opt/shaders-msl/asm/frag/unreachable-return.msl23.spv14.asm.frag
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,25 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct buff_t | ||
{ | ||
int m0[1024]; | ||
}; | ||
|
||
struct main0_out | ||
{ | ||
float4 frag_clr [[color(0)]]; | ||
}; | ||
|
||
fragment main0_out main0(device buff_t& buff [[buffer(0)]], float4 gl_FragCoord [[position]]) | ||
{ | ||
main0_out out = {}; | ||
int4 _16 = int4(gl_FragCoord); | ||
out.frag_clr = float4(0.0, 0.0, 1.0, 1.0); | ||
buff.m0[(_16.y * 32) + _16.x] = 1; | ||
discard_fragment(); | ||
return out; | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
reference/shaders-msl-no-opt/vert/no-position-write.auto-disable-rasterization.msl21.vert
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 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct main0_out | ||
{ | ||
int o_value [[user(locn0)]]; | ||
}; | ||
|
||
vertex void main0() | ||
{ | ||
main0_out out = {}; | ||
out.o_value = 10; | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
reference/shaders-msl-no-opt/vert/no-position-write.disable-rasterization.msl21.vert
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 @@ | ||
#include <metal_stdlib> | ||
#include <simd/simd.h> | ||
|
||
using namespace metal; | ||
|
||
struct main0_out | ||
{ | ||
int o_value [[user(locn0)]]; | ||
float4 gl_Position [[position, invariant]]; | ||
}; | ||
|
||
vertex void main0() | ||
{ | ||
main0_out out = {}; | ||
out.o_value = 10; | ||
out.gl_Position = float4(10.0); | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
shaders-msl-no-opt/vert/no-position-write.auto-disable-rasterization.msl21.vert
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 @@ | ||
#version 450 | ||
|
||
out gl_PerVertex | ||
{ | ||
invariant vec4 gl_Position; | ||
}; | ||
|
||
layout(location = 0) out int o_value; | ||
|
||
void main() | ||
{ | ||
o_value = 10; | ||
} |
14 changes: 14 additions & 0 deletions
14
shaders-msl-no-opt/vert/no-position-write.disable-rasterization.msl21.vert
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,14 @@ | ||
#version 450 | ||
|
||
out gl_PerVertex | ||
{ | ||
invariant vec4 gl_Position; | ||
}; | ||
|
||
layout(location = 0) out int o_value; | ||
|
||
void main() | ||
{ | ||
o_value = 10; | ||
gl_Position = vec4(10.0); | ||
} |
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
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