skia2/tests/sksl/shared/StaticIf.metal

23 lines
539 B
Metal
Raw Normal View History

struct Uniforms {
float4 colorRed;
float4 colorGreen;
};
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;
float4 result = _uniforms.colorRed;
# Enter a description of the change. Reland "Migrate if-statement simplifyStatement logic to IfStatement::Make." This reverts commit 7e685f0377b161637f5e091e3f7320197f000a70. Reason for revert: fixed SkSLBench perf test Original change's description: > Revert "Migrate if-statement simplifyStatement logic to IfStatement::Make." > > This reverts commit e4da7b672f4012cbbad92c32a2810df8ab28af9e. > > Reason for revert: breaks SkSLBench perf test > > Original change's description: > > Migrate if-statement simplifyStatement logic to IfStatement::Make. > > > > This performs essentially the same simplifications as before, just at > > a different phase of compilation. > > > > Change-Id: Ia88df6857d4089962505cd1281798fda74fd0b02 > > Bug: skia:11343, skia:11319 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376177 > > Commit-Queue: John Stiles <johnstiles@google.com> > > Auto-Submit: John Stiles <johnstiles@google.com> > > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com > > Change-Id: I0051188ffe69426904066eb60a932435efdc2af8 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:11343 > Bug: skia:11319 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379062 > Reviewed-by: John Stiles <johnstiles@google.com> > Commit-Queue: John Stiles <johnstiles@google.com> Bug: skia:11343 Bug: skia:11319 Change-Id: I74cc3295004133e9fdcf16e388106eb83603f526 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379063 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-03 21:13:45 +00:00
const float x = 5.0;
const float y = 10.0;
{
result = _uniforms.colorGreen;
}
_out.sk_FragColor = result;
return _out;
}