diff options
author | Samuel Iglesias Gonsalvez <[email protected]> | 2015-03-18 15:32:03 +0100 |
---|---|---|
committer | Samuel Iglesias Gonsalvez <[email protected]> | 2015-09-25 08:39:21 +0200 |
commit | f3f64cd0c4b9cf3363056ddc9c4d7616614ce829 (patch) | |
tree | 5b355b772fca5c6df5c3fe3421570ddfb773e862 /src/glsl/ast_array_index.cpp | |
parent | f45d39f6afc436ee4c68a21382933b2b39879eef (diff) |
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 <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl/ast_array_index.cpp')
-rw-r--r-- | src/glsl/ast_array_index.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp index ae399f03a9b..dfb31073f82 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() |