third_party/spirv-cross/reference/opt/shaders-msl/frag/front-facing.frag
raw| 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | |
| 4 | using namespace metal; |
| 5 | |
| 6 | struct main0_out |
| 7 | { |
| 8 | float4 FragColor [[color(0)]]; |
| 9 | }; |
| 10 | |
| 11 | struct main0_in |
| 12 | { |
| 13 | float4 vA [[user(locn0)]]; |
| 14 | float4 vB [[user(locn1)]]; |
| 15 | }; |
| 16 | |
| 17 | fragment main0_out main0(main0_in in [[stage_in]], bool gl_FrontFacing [[front_facing]]) |
| 18 | { |
| 19 | main0_out out = {}; |
| 20 | if (gl_FrontFacing) |
| 21 | { |
| 22 | out.FragColor = in.vA; |
| 23 | } |
| 24 | else |
| 25 | { |
| 26 | out.FragColor = in.vB; |
| 27 | } |
| 28 | return out; |
| 29 | } |
| 30 |