skia2/tests/sksl/inliner/TrivialArgumentsInlineDirectly.glsl
John Stiles 0c9d888748 Run SkSL inliner tests as part of dm.
Previously, these tests were never actually executed, only read during
code review. They are now properly tested for correctness whenever dm
is run. Non-ES2 compliant statements (do/while/switch) are unfortunately
excluded here, as they are not compatible with Runtime Effects yet.

Change-Id: I965c782baad6f8dd3961a400ae791fb2c1f844d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389296
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-25 22:58:54 +00:00

41 lines
1.1 KiB
GLSL

out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform float unknownInput;
struct S {
vec4 ah4[1];
float ah[1];
vec4 h4;
float h;
};
vec4 main() {
S s;
s.ah4[0] = vec4(unknownInput);
s.ah[0] = unknownInput;
s.h4 = vec4(unknownInput);
s.h = unknownInput;
S as[1];
as[0].ah4[0] = vec4(unknownInput);
bool b = bool(unknownInput);
vec4 var;
var = vec4(s.h) * vec4(s.h);
var = vec4(float(b), float(b), float(b), float(!b));
var = s.ah4[0].ywyw * s.ah4[0].wywy;
var = as[0].ah4[0].xyxy * as[0].ah4[0].yxyx;
var = s.h4.zzzz * s.h4.zzzz;
var = colorGreen.xyzx * colorGreen.xyzx;
var = vec4(s.h) * vec4(s.h);
var = vec4(s.h) * vec4(s.h);
var = s.ah4[0].xxxy * s.ah4[0].xxxy;
var = colorGreen * colorGreen;
float _0_h = -s.h;
var = vec4(_0_h) * vec4(_0_h);
bool _1_b = !b;
var = vec4(float(_1_b), float(_1_b), float(_1_b), float(!_1_b));
vec3 _2_h3 = s.h4.yyy + s.h4.zzz;
var = _2_h3.xyzx * _2_h3.xyzx;
vec4 _3_h4 = vec4(s.h4.y, 0.0, 0.0, 1.0);
var = _3_h4 * _3_h4;
return colorGreen;
}