xref: /aosp_15_r20/external/skia/resources/sksl/runtime/ConstPreservation.rts (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1/*#pragma settings NoInline*/
2
3// Ensure that 'const' is preserved on variable and function declarations in the .stage output
4const half r = 0;
5
6noinline half opt_barrier(const half x) {
7    return x;
8}
9
10half2 compute_ba(const half2 rg) {
11    return rg;
12}
13
14half4 main(float2 xy) {
15    const half g = r + 1;
16    return half4(opt_barrier(r), g, compute_ba(half2(r, opt_barrier(g))));
17}
18