summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_array_index.cpp
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>2015-03-18 15:32:03 +0100
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>2015-09-25 08:39:21 +0200
commitf3f64cd0c4b9cf3363056ddc9c4d7616614ce829 (patch)
tree5b355b772fca5c6df5c3fe3421570ddfb773e862 /src/glsl/ast_array_index.cpp
parentf45d39f6afc436ee4c68a21382933b2b39879eef (diff)
downloadexternal_mesa3d-f3f64cd0c4b9cf3363056ddc9c4d7616614ce829.zip
external_mesa3d-f3f64cd0c4b9cf3363056ddc9c4d7616614ce829.tar.gz
external_mesa3d-f3f64cd0c4b9cf3363056ddc9c4d7616614ce829.tar.bz2
glsl: add support for unsized arrays in shader storage blocks
They only can be defined in the last position of the shader storage blocks. When an unsized array is used in different shaders, it might be converted in different sized arrays, avoid get a linker error in that case. v2: - Rework error condition and error messages (Timothy Arceri) v3: - Move OpenGL ES check to its own patch. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Diffstat (limited to 'src/glsl/ast_array_index.cpp')
-rw-r--r--src/glsl/ast_array_index.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp
index ae399f0..dfb3107 100644
--- a/src/glsl/ast_array_index.cpp
+++ b/src/glsl/ast_array_index.cpp
@@ -226,7 +226,8 @@ _mesa_ast_array_index_to_hir(void *mem_ctx,
* by the linker.
*/
}
- else {
+ else if (array->variable_referenced()->data.mode !=
+ ir_var_shader_storage) {
_mesa_glsl_error(&loc, state, "unsized array index must be constant");
}
} else if (array->type->fields.array->is_interface()