skia2/resources/sksl/runtime/ConstPreservation.rte
Brian Osman 86e85537fe Test that we propagate 'const' to the GPU backend of runtime effects
Currently, only one of three uses (local variables) does this correctly.

Bug: skia:11716
Change-Id: Iad11e8e5998fcc7caee4d438e0558c5d4e2b1821
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/382277
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-09 23:26:00 +00:00

14 lines
290 B
Plaintext

/*#pragma settings NoInline*/
// Ensure that 'const' is preserved on variable and function declarations in the .stage output
const half r = 0;
half2 compute_ba(const half2 rg) {
return rg;
}
half4 main() {
const half g = r + 1;
return half4(r, g, compute_ba(half2(r, g)));
}