skia2/tests/sksl/shared/TernaryExpression.metal
Jim Van Verth e7a8f85e4f Only include header once in combined MSL shader.
Bug: skia:11389
Change-Id: I3e24dcaa2cfeddc7efd7985f9f42a59bfc8175f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385137
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-03-15 21:42:06 +00:00

22 lines
641 B
Metal

struct Uniforms {
float4 colorGreen;
float4 colorRed;
};
struct Inputs {
};
struct Outputs {
float4 sk_FragColor [[color(0)]];
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out;
(void)_out;
const bool TRUE = true;
const bool FALSE = false;
bool ok = true;
ok = ok && (_uniforms.colorGreen.y == 1.0 ? true : false);
ok = ok && (_uniforms.colorGreen.x == 1.0 ? false : true);
_out.sk_FragColor = ok ? _uniforms.colorGreen : _uniforms.colorRed;
return _out;
}