summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-06-14 10:13:41 +1000
committerEmil Velikov <[email protected]>2016-06-15 09:29:13 +0100
commit883a1b3bd22fae39bd8cc8f997a00ba61618a37d (patch)
treecea2da24b0c1e8eecb850593cfaeaee8b76e7373 /src/compiler
parenta71e0fd8cdf1f488b8a7e07080aac59505064741 (diff)
glsl: make sure UBO arrays are sized in ES
This check was removed in 5b2675093e86 add it back in. Reviewed-by: Dave Airlie <[email protected]> Cc: "12.0" <[email protected]> https://bugs.freedesktop.org/show_bug.cgi?id=96349 (cherry picked from commit b010fa85675b98962426fe8961466fbae2d25499)
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index b7192b29f2d..5f4efd9d0e5 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -7613,6 +7613,20 @@ ast_interface_block::hir(exec_list *instructions,
if (is_unsized_array_last_element(var)) {
var->data.from_ssbo_unsized_array = true;
}
+ } else {
+ /* From GLSL ES 3.10 spec, section 4.1.9 "Arrays":
+ *
+ * "If an array is declared as the last member of a shader storage
+ * block and the size is not specified at compile-time, it is
+ * sized at run-time. In all other cases, arrays are sized only
+ * at compile-time."
+ */
+ if (state->es_shader) {
+ _mesa_glsl_error(&loc, state, "unsized array `%s' "
+ "definition: only last member of a shader "
+ "storage block can be defined as unsized "
+ "array", fields[i].name);
+ }
}
}