skia2/tests/sksl/shared/golden/ArrayConstructors.glsl
John Stiles bf282c05e5 Replace array indexing on vector types with swizzles.
Our optimizer ignores index expressions, but has a few simplifications
that it can perform on swizzles. (Added extra code to SwizzleByIndex
which demonstrates this.)

Change-Id: If3c85a0456d98749008d796e422944b602ee6933
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341460
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-07 21:16:40 +00:00

9 lines
227 B
GLSL

out vec4 sk_FragColor;
float test1[] = float[](1.0, 2.0, 3.0, 4.0);
vec2 test2[] = vec2[](vec2(1.0, 2.0), vec2(3.0, 4.0));
mat4 test3[] = mat4[]();
void main() {
sk_FragColor.x = (test1[0] + test2[0].x) + test3[0][0].x;
}