Add GLSL support for runtime-sized arrays in SSBOs
The GLSL parser now allows a runtime-sized array as the last member in
a shader storage block. Clamping indexing against the memory bounds is
done by determining the array length at runtime.
Runtime-sized arrays are used in dEQP tests for many compute shader
tests, so these now work on the OpenGL backend.
BUG=angleproject:1951
TEST=angle_unittests,
dEQP-GLES31.functional.shaders.linkage.shader_storage_block.*
dEQP-GLES31.functional.shaders.builtin_functions.*compute*
Change-Id: Ibecca24623ca8e4723af6f0e0421fe9711ea828d
Reviewed-on: https://chromium-review.googlesource.com/787976
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/compiler/translator/ParseContext.h b/src/compiler/translator/ParseContext.h
index 6cf5fad..8bfdbd5 100644
--- a/src/compiler/translator/ParseContext.h
+++ b/src/compiler/translator/ParseContext.h
@@ -462,11 +462,11 @@
constexpr static size_t kAtomicCounterArrayStride = 4;
// Returns a clamped index. If it prints out an error message, the token is "[]".
- int checkIndexOutOfRange(bool outOfRangeIndexIsError,
- const TSourceLoc &location,
- int index,
- int arraySize,
- const char *reason);
+ int checkIndexLessThan(bool outOfRangeIndexIsError,
+ const TSourceLoc &location,
+ int index,
+ int arraySize,
+ const char *reason);
bool declareVariable(const TSourceLoc &line,
const TString &identifier,