From f3f64cd0c4b9cf3363056ddc9c4d7616614ce829 Mon Sep 17 00:00:00 2001 From: Samuel Iglesias Gonsalvez Date: Wed, 18 Mar 2015 15:32:03 +0100 Subject: glsl: add support for unsized arrays in shader storage blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jordan Justen Reviewed-by: Kristian Høgsberg --- src/glsl/ir.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/glsl/ir.h') diff --git a/src/glsl/ir.h b/src/glsl/ir.h index cf1954b1257..48b6795cc09 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -452,6 +452,15 @@ public: this->interface_type != NULL; } + /** + * Determine whether or not a variable is part of a shader storage block. + */ + inline bool is_in_shader_storage_block() const + { + return this->data.mode == ir_var_shader_storage && + this->interface_type != NULL; + } + /** * Determine whether or not a variable is the declaration of an interface * block @@ -777,6 +786,11 @@ public: unsigned image_volatile:1; unsigned image_restrict:1; + /** + * ARB_shader_storage_buffer_object + */ + unsigned from_ssbo_unsized_array:1; /**< unsized array buffer variable. */ + /** * Emit a warning if this variable is accessed. */ -- cgit v1.2.3