skia2/tests/sksl/shared/OutParamsTricky.glsl
John Stiles ece1d794b9 Mangle function names in GLSL.
This will be implemented in Metal and SPIR-V in followup CLs.

Change-Id: I397b4db40b15dd54cf1d8a17f414c3fe184b48d2
Bug: skia:10851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/387638
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-22 17:18:26 +00:00

18 lines
451 B
GLSL

out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
vec2 tricky_h2hhh2h(float x, float y, inout vec2 color, float z) {
color = color.yx;
return vec2(x + y, z);
}
void func_vh4(inout vec4 color) {
vec2 t = tricky_h2hhh2h(1.0, 2.0, color.xz, 5.0);
color.yw = t;
}
vec4 main() {
vec4 result = vec4(0.0, 1.0, 2.0, 3.0);
func_vh4(result);
return result == vec4(2.0, 3.0, 0.0, 5.0) ? colorGreen : colorRed;
}