956802335d
This is a reland ofc412688798
This CL lands the code changes but not the dm test, which is causing link errors. Tests will be relanded as a separate CL, at http://review.skia.org/400097 Original change's description: > Reland "Implement statements and expressions in DSL C++ code generator." > > This is a reland of16cbfb41df
> > Tests now rely on `shaderDerivativeSupport` and `integerSupport` as > proxies to indicate ES3 support. The SwitchStatement test has been > adjusted to hopefully confuse fewer compilers. > > Original change's description: > > Implement statements and expressions in DSL C++ code generator. > > > > This CL removes the bulk of the existing C++ code generator, especially > > all the complex format-string assembly code. It has been replaced with > > actual DSL code generation. Simple IR can now be successfully translated > > to a working DSL fragment processor. > > > > This CL also adds a simple test harness which is patterned after the > > existing SkSLTest; it renders a pixel, reads it back, and fails the test > > if the result isn't solid green (RGBA=0101). > > > > This CL doesn't implement every feature. Some obvious gaps include: > > - Sampling from children > > - Uniforms/inputs of any kind > > - Function calls of any kind > > > > Change-Id: Ib80c23fe1ba4453f7c3cb43b65f93c5ea0deb709 > > Bug: skia:11854 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396757 > > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > > Reviewed-by: Brian Osman <brianosman@google.com> > > Commit-Queue: John Stiles <johnstiles@google.com> > > Bug: skia:11854, skia:11891 > Change-Id: I91363e31f34611d15ae350b52d6fc459feeace9c > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399076 > Auto-Submit: John Stiles <johnstiles@google.com> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Bug: skia:11854 Bug: skia:11891 Change-Id: Ib1f08256c84d1da2130e0b61356f72435dc0a5a8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399740 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
70 lines
1.4 KiB
GLSL
70 lines
1.4 KiB
GLSL
half4 main() {
|
|
half4 v = half4(1, 2, 3, 4);
|
|
|
|
v = half4(v.x, 1, 1, 1);
|
|
v = half4(v.xy, 1, 1);
|
|
v = half4(v.x1, 1, 1);
|
|
v = half4(v.0y, 1, 1);
|
|
v = half4(v.xyz, 1);
|
|
v = half4(v.xy1, 1);
|
|
v = half4(v.x0z, 1);
|
|
v = half4(v.x10, 1);
|
|
v = half4(v.1yz, 1);
|
|
v = half4(v.0y1, 1);
|
|
v = half4(v.11z, 1);
|
|
v = v.xyzw;
|
|
v = v.xyz1;
|
|
v = v.wwww;
|
|
v = v.xy10;
|
|
v = v.xzzx;
|
|
v = v.x0z1;
|
|
v = v.x11w;
|
|
v = v.x101;
|
|
v = v.1yzw;
|
|
v = v.0yz1;
|
|
v = v.0y1w;
|
|
v = v.1y11;
|
|
v = v.00zw;
|
|
v = v.00z1;
|
|
v = v.011w;
|
|
|
|
v = v.rgba;
|
|
v = v.rgb0.abgr;
|
|
v = v.rgba.00ra;
|
|
v = v.rgba.rrra.00ra.11ab;
|
|
v = v.abga.gb11;
|
|
v = v.abgr.abgr;
|
|
v = half4(v.rrrr.bb, 1, 1);
|
|
v = half4(v.ba.grgr);
|
|
|
|
bool4 b = bool4(true, true, true, true);
|
|
b = bool4(b.x, true, true, true);
|
|
b = bool4(b.xy, false, true);
|
|
b = bool4(b.x1, true, false);
|
|
b = bool4(b.0y, true, true);
|
|
b = bool4(b.xyz, true);
|
|
b = bool4(b.xy1, true);
|
|
b = bool4(b.x0z, true);
|
|
b = bool4(b.x10, false);
|
|
b = bool4(b.1yz, false);
|
|
b = bool4(b.0y1, false);
|
|
b = bool4(b.11z, false);
|
|
b = b.xyzw;
|
|
b = b.xyz1;
|
|
b = b.wwww;
|
|
b = b.xy10;
|
|
b = b.xzzx;
|
|
b = b.x0z1;
|
|
b = b.x11w;
|
|
b = b.x101;
|
|
b = b.1yzw;
|
|
b = b.0yz1;
|
|
b = b.0y1w;
|
|
b = b.1y11;
|
|
b = b.00zw;
|
|
b = b.00z1;
|
|
b = b.011w;
|
|
|
|
return half4(b.xy, 0, v.z);
|
|
}
|