summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2015-10-01 14:54:33 +0300
committerTapani Pälli <[email protected]>2015-10-02 08:37:02 +0300
commita552b77dccacbbf68af3c527273085224b2b4480 (patch)
tree8b25e5e842627fed6d43f655af357d61ce5e6368 /src/glsl
parentb3f9c5cc0fab6d770d220efd87ba3746c6673875 (diff)
glsl: error out if non-constant indexing of SSBO arrays with GLSL ES
Fixes a failing subtest in: ES31-CTS.shader_storage_buffer_object.negative-glsl-compileTime Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_array_index.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index dfb31073f82..5e8f49d70b0 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -231,15 +231,17 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
_mesa_glsl_error(&loc, state, "unsized array index must be constant");
}
} else if (array->type->fields.array->is_interface()
- && array->variable_referenced()->data.mode == ir_var_uniform
+ && (array->variable_referenced()->data.mode == ir_var_uniform ||
+ array->variable_referenced()->data.mode == ir_var_shader_storage)
&& !state->is_version(400, 0) && !state->ARB_gpu_shader5_enable) {
- /* Page 46 in section 4.3.7 of the OpenGL ES 3.00 spec says:
+ /* Page 50 in section 4.3.9 of the OpenGL ES 3.10 spec says:
*
- * "All indexes used to index a uniform block array must be
- * constant integral expressions."
+ * "All indices used to index a uniform or shader storage block
+ * array must be constant integral expressions."
*/
- _mesa_glsl_error(&loc, state,
- "uniform block array index must be constant");
+ _mesa_glsl_error(&loc, state, "%s block array index must be constant",
+ array->variable_referenced()->data.mode
+ == ir_var_uniform ? "uniform" : "shader storage");
} else {
/* whole_variable_referenced can return NULL if the array is a
* member of a structure. In this case it is safe to not update