9ea48e3965
GLSL only allows one-dimensional arrays. This CL lowers SkSL's array dimensionality limit from eight to one, and fixes all the tests that this breaks. The rest of the code still technically supports arbitrarily-deep array dimensionality; there are many opportunities for code cleanup and simplification in followup CLs. Change-Id: I0fc31e4626649ec69d40c5f5597b3924de298df0 Bug: skia:11026 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340339 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
61 lines
617 B
Metal
61 lines
617 B
Metal
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
using namespace metal;
|
|
struct S1 {
|
|
int x;
|
|
};
|
|
struct S2 {
|
|
S1 x;
|
|
};
|
|
struct S3 {
|
|
S2 x;
|
|
};
|
|
struct S4 {
|
|
S3 x;
|
|
};
|
|
struct S5 {
|
|
S4 x;
|
|
};
|
|
struct S6 {
|
|
S5 x;
|
|
};
|
|
struct S7 {
|
|
S6 x;
|
|
};
|
|
struct S8 {
|
|
S7 x;
|
|
};
|
|
struct SA1 {
|
|
int x[8];
|
|
};
|
|
struct SA2 {
|
|
SA1 x[7];
|
|
};
|
|
struct SA3 {
|
|
SA2 x[6];
|
|
};
|
|
struct SA4 {
|
|
SA3 x[5];
|
|
};
|
|
struct SA5 {
|
|
SA4 x[4];
|
|
};
|
|
struct SA6 {
|
|
SA5 x[3];
|
|
};
|
|
struct SA7 {
|
|
SA6 x[2];
|
|
};
|
|
struct SA8 {
|
|
SA7 x[1];
|
|
};
|
|
struct Inputs {
|
|
S8 s8;
|
|
SA8 sa8[9];
|
|
};
|
|
struct Outputs {
|
|
float4 sk_FragColor [[color(0)]];
|
|
};
|
|
|
|
|