third_party/spirv-cross/reference/shaders-msl/frag/spec-constant-ternary.frag
raw| 1 | #include <metal_stdlib> |
| 2 | #include <simd/simd.h> |
| 3 | |
| 4 | using namespace metal; |
| 5 | |
| 6 | constant uint s_tmp [[function_constant(0)]]; |
| 7 | constant uint s = is_function_constant_defined(s_tmp) ? s_tmp : 10u; |
| 8 | constant bool _13 = (s > 20u); |
| 9 | constant uint f = _13 ? 30u : 50u; |
| 10 | |
| 11 | struct main0_out |
| 12 | { |
| 13 | float FragColor [[color(0)]]; |
| 14 | }; |
| 15 | |
| 16 | fragment main0_out main0() |
| 17 | { |
| 18 | main0_out out = {}; |
| 19 | out.FragColor = float(f); |
| 20 | return out; |
| 21 | } |
| 22 |