2020-09-30 14:37:23 +00:00
|
|
|
in half val;
|
|
|
|
uniform int ui;
|
|
|
|
uniform half4 uh4;
|
2021-01-07 18:47:53 +00:00
|
|
|
uniform bool b;
|
2020-09-30 14:37:23 +00:00
|
|
|
|
|
|
|
struct S {
|
|
|
|
half4 ah4[1];
|
|
|
|
half ah[1];
|
|
|
|
half4 h4;
|
|
|
|
half h;
|
|
|
|
};
|
|
|
|
|
2021-03-17 17:20:10 +00:00
|
|
|
half4 funcb(bool b) {
|
|
|
|
return b ? sk_FragColor.xxxx : sk_FragColor.yyyy;
|
2020-09-30 14:37:23 +00:00
|
|
|
}
|
|
|
|
|
2021-03-17 17:20:10 +00:00
|
|
|
half4 func1(half h) {
|
|
|
|
return h.xxxx;
|
2020-09-30 14:37:23 +00:00
|
|
|
}
|
|
|
|
|
2021-03-17 17:20:10 +00:00
|
|
|
half4 func2(half2 h2) {
|
|
|
|
return h2.xyxy;
|
2020-09-30 14:37:23 +00:00
|
|
|
}
|
|
|
|
|
2021-03-17 17:20:10 +00:00
|
|
|
half4 func3(half3 h3) {
|
|
|
|
return h3.xyzx;
|
2020-09-30 14:37:23 +00:00
|
|
|
}
|
|
|
|
|
2021-03-17 17:20:10 +00:00
|
|
|
half4 func4(half4 h4) {
|
|
|
|
return h4;
|
2020-09-30 14:37:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
S s;
|
|
|
|
s.ah4[0] = half4(val);
|
|
|
|
s.ah[0] = val;
|
|
|
|
s.h4 = half4(val);
|
|
|
|
s.h = val;
|
|
|
|
|
|
|
|
S as[1];
|
|
|
|
as[0].ah4[0] = half4(val);
|
|
|
|
|
|
|
|
// These expressions are considered "trivial" and will be cloned directly into the inlined
|
|
|
|
// function without a temporary variable.
|
2021-03-17 17:20:10 +00:00
|
|
|
sk_FragColor = funcb(sk_Caps.floatIs32Bits);
|
|
|
|
sk_FragColor = func1(+s.h);
|
|
|
|
sk_FragColor = funcb(b);
|
|
|
|
sk_FragColor = func2(s.ah4[0].yw);
|
|
|
|
sk_FragColor = func2(as[0].ah4[0].xy);
|
|
|
|
sk_FragColor = func3(s.h4.zzz);
|
|
|
|
sk_FragColor = func3(uh4.xyz);
|
|
|
|
sk_FragColor = func3(s.h.xxx);
|
|
|
|
sk_FragColor = func4(half4(s.h));
|
|
|
|
sk_FragColor = func4(s.ah4[0].xxxy);
|
|
|
|
sk_FragColor = func4(uh4);
|
2020-09-30 14:37:23 +00:00
|
|
|
|
|
|
|
// These expressions are considered "non-trivial" and will be placed in a temporary variable
|
|
|
|
// when inlining occurs.
|
2021-03-17 17:20:10 +00:00
|
|
|
sk_FragColor = funcb(!sk_Caps.floatIs32Bits);
|
|
|
|
sk_FragColor = func1(-s.h);
|
|
|
|
sk_FragColor = funcb(!b);
|
|
|
|
sk_FragColor = func2(s.ah4[ui].yw);
|
|
|
|
sk_FragColor = func3(s.h4.yyy + s.h4.zzz);
|
|
|
|
sk_FragColor = func4(s.h4.y001);
|
2020-09-30 14:37:23 +00:00
|
|
|
}
|