skia2/tests/sksl/shared/golden/ResizeMatrix.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

16 lines
551 B
GLSL

out vec4 sk_FragColor;
void main() {
sk_FragColor.x = mat2(mat3(1.0))[0].x;
sk_FragColor.x = mat2(mat4(1.0))[0].x;
sk_FragColor.x = mat3(mat4(1.0))[0].x;
sk_FragColor.x = mat3(mat2(1.0))[0].x;
sk_FragColor.x = mat3(mat2x3(1.0))[0].x;
sk_FragColor.x = mat3(mat3x2(1.0))[0].x;
sk_FragColor.x = mat4(mat3(mat2(1.0)))[0].x;
sk_FragColor.x = mat4(mat4x3(mat4x2(1.0)))[0].x;
sk_FragColor.x = mat4(mat3x4(mat2x4(1.0)))[0].x;
sk_FragColor.x = mat2x4(mat4x2(1.0))[0].x;
sk_FragColor.x = mat4x2(mat2x4(1.0))[0].x;
}