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>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user