xref: /aosp_15_r20/external/skia/resources/sksl/runtime/QualifierOrder.rts (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1uniform half4 colorGreen;
2
3// GLSL 4.1 and below enforce that qualifiers must occur in a strict order. (See "Order of
4// Qualifiers" in the GLSL documentation.) GLSL 4.2 and above no longer enforce order; SkSL also
5// does not. However, SkSL will always emit qualifiers in the order expected by GLSL 4.1.
6
7// These qualifiers are reversed from the expected order, but SkSL should compile and run anyway.
8noinline void const_after_in(in const vec2 x) {}
9noinline void inout_after_high_precision(highp inout vec2 x) {}
10noinline void out_after_high_precision(highp out vec2 x) { x = vec2(0); }
11
12vec4 main(vec2 coords) {
13    const_after_in(coords);
14    inout_after_high_precision(coords);
15    out_after_high_precision(coords);
16
17    return colorGreen;
18}
19