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