skia2/resources/sksl/errors/VectorInlinedIndexOutOfRange.sksl
John Stiles 0b84159e3b Improve array-indexing tests.
Previously, we didn't have tests which leveraged constant-evaluation of
array indexing (because we didn't support it), and our test files
commingled constant-indexing into vectors with constant-indexing into
arrays.

The test files now separate vector- and array-handling into separate
tests, and a ton of new cases have been added to ArrayFolding. The
ArrayFolding tests now require constant-evaluation of array indexing,
so they fail in this CL, but will be fixed in the followup CL.

Change-Id: I3b663e743d97d6db80627bc9b7808f88c99917a7
Bug: skia:12472
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469528
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-11-10 18:31:28 +00:00

14 lines
302 B
Plaintext

uniform half4 colorGreen, colorRed;
const int3 values = int3(1);
inline int indexVector(int index) {
return values[index];
}
half4 main(float2 coords) {
int ok = indexVector(0) + indexVector(1) + indexVector(2);
int undefined = indexVector(-1) + indexVector(3);
return colorGreen;
}