Lines Matching refs:float2
41 #define EMPTY_MAIN "half4 main(float2 p) { return half4(0); }"
52 test_invalid_effect(r, "in float2 v;" EMPTY_MAIN, "'in'");
57 test_invalid_effect(r, "half4 missing(); half4 main(float2 p) { return missing(); }",
70 "half4 main(float2 p) { return sk_Caps.integerSupport ? half4(1) : half4(0); }",
137 test_invalid("half4 main(float2 p) { return half4(1); }", "'main' parameter");
138 test_invalid("half4 main(float2 p, half4 c) { return c; }", "'main' parameter");
190 test_invalid("half4 main(float2 p) { return half4(1); }", "'main' parameter");
191 test_invalid("half4 main(float2 p, half4 c) { return c; }", "'main' parameter");
192 test_invalid("half4 main(float2 p, half4 a, half4 b) { return a; }", "'main' parameter");
231 // Shaders must use either the 'half4 main(float2)' or 'half4 main(float2, half4)' signature
232 // Either color can be half4/float4/vec4, but the coords must be float2/vec2
233 test_valid("half4 main(float2 p) { return p.xyxy; }");
234 test_valid("float4 main(float2 p) { return p.xyxy; }");
235 test_valid("vec4 main(float2 p) { return p.xyxy; }");
238 test_valid("half4 main(float2 p, half4 c) { return c; }");
239 test_valid("half4 main(float2 p, float4 c) { return c; }");
240 test_valid("half4 main(float2 p, vec4 c) { return c; }");
241 test_valid("float4 main(float2 p, half4 c) { return c; }");
242 test_valid("vec4 main(float2 p, half4 c) { return c; }");
246 test_invalid("void main(float2 p) {}", "'main' must return");
247 test_invalid("half3 main(float2 p) { return p.xy1; }", "'main' must return");
254 test_invalid("half4 main(float2 p) { return sk_FragCoord.xy01; }",
259 test_valid("half4 main(float2 p) { return sk_FragCoord.xy01; }", optionsWithFragCoord);
263 "half4 main(float2 p) { return child.eval(p); }");
267 "half4 main(float2 p, half4 c) { return child.eval(c); }");
271 "half4 main(float2 p, half4 c) { return child.eval(c, c); }");
436 effect.build("half4 main(float2 p) { return half4(half2(p - 0.5), 0, 1); }");
440 effect.build("uniform float4 gColor; half4 main(float2 p) { return half4(gColor); }");
447 effect.build("uniform int4 gColor; half4 main(float2 p) { return half4(gColor) / 255.0; }");
457 "half4 main(float2 p) { return half4(0.498 * (half2(sk_FragCoord.xy) - 0.5), 0, 1); }");
462 effect.build("half4 main(float2 p) { return float4(p - 0.5, 0, 1); }");
466 effect.build("float4 main(float2 p) { return float4(p - 0.5, 0, 1); }");
468 effect.build("vec4 main(float2 p) { return float4(p - 0.5, 0, 1); }");
484 "half4 main(float2 p) { return child.eval(p); }");
493 "half4 main(float2 p) { return child.eval(p); }");
499 "half4 main(float2 p) { return child.eval(p.yx); }");
506 "half4 main(float2 p) { return half4(0, 1, 0, 1); }");
515 effect.build("float2 helper(float2 x) { return x + 1; }"
516 "half4 main(float2 p) { float2 v = helper(p); return half4(half2(v), 0, 1); }");
536 using float2 = std::array<float, 2>;
616 effect.uniform("pos") = float2{0, 0};
619 effect.uniform("pos") = float2{1, 0};
622 effect.uniform("pos") = float2{0, 1};
625 effect.uniform("pos") = float2{1, 1};
662 half4 main(float2 p) { return half4(x); }
698 half4 main(float2 p) { return half4(x); }
727 static constexpr char kSource[] = "half4 main(float2 p) { return sk_FragCoord.xyxy; }";
768 "half4 main(float2 p) { S s; s.rgba = paint.eval(p); process(s); return s.rgba; }"
785 "struct S { float2 coord; };"
787 "half4 main(float2 p) { S s; s.coord = p; process(s); return child.eval(s.coord); "
847 test("half4 main(float2 xy) { return child.eval(xy); }", false, false);
849 test("half4 main(float2 xy) { return child.eval(xy) + sin(xy.x); }", false, true);
854 test("half4 main(float2 xy) { return child.eval(float2(0, 0)); }", true, false);
856 test("half4 main(float2 xy) { return child.eval(xy * 0.5); }", true, true);
858 test("half4 main(float2 xy) { xy *= 2; return child.eval(xy); }", true, true);
860 test("void adjust(inout float2 xy) { xy *= 2; }"
861 "half4 main(float2 xy) { adjust(xy); return child.eval(xy); }", true, true);
867 test("half4 main(float2 xy) { half4 c = child.eval(xy); xy *= 2; return c; }", true, true);
869 test("half4 main(float2 xy) { float2 p = xy; return child.eval(p); }", true, true);
871 test("half4 helper(float2 xy) { return child.eval(xy); }"
872 "half4 main(float2 xy) { return helper(xy); }", true, true);
886 half4 main(float2 xy) { return color; }
928 half4 main(float2 xy) { return half4(color[0], color[1], color[2], color[3]); }