skia2/tests/sksl/errors/golden/ArrayUnspecifiedDimensions.glsl
John Stiles e1bbd5c128 Disallow unsized array dimensions on size fields past the frontmost.
This was slightly complicated by the fact that this syntax indicates an
array with a known size:

    float[] x = float[](1, 2, 3, 4);

Of course, the size is 4; it's just never explicitly stated in the
code. (The SkSL parser never actually deduces the size, but it doesn't
apparently have a need to; we don't do much in the way of optimization
for arrays.) However, this prevents us from simply failing whenever we
parse "[]" in non-builtin code; we need to keep scanning and see if the
variable is initialized. We already check this in the
ArrayConstructors.sksl test file.

Change-Id: I5b86958e81bd9bf5edf28a617cecf95c1875583e
Bug: skia:10957
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335240
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-17 16:44:13 +00:00

18 lines
671 B
GLSL

### Compilation failed:
error: 1: arrays without an explicit size must use an initializer expression
error: 2: array size must be specified
error: 3: array size must be specified
error: 4: array size must be specified
error: 5: array size must be specified
error: 6: array size must be specified
error: 7: array size must be specified
error: 8: array size must be specified
error: 9: array size must be specified
error: 10: array size must be specified
error: 11: array size must be specified
error: 12: expected 'int', but found 'float'
error: 13: expected 'int', but found 'bool'
error: 14: arrays without an explicit size must use an initializer expression
14 errors