From: Samuel Iglesias Gonsalvez Date: Wed, 18 Mar 2015 09:25:10 +0000 (+0100) Subject: glsl: shader buffer variables cannot have initializers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=20b2907db7b93656cbafe1d24302498e5817dbe2;p=mesa.git glsl: shader buffer variables cannot have initializers Section 4.3.7 "Buffer Variables" of the GLSL 4.30 spec: "Buffer variables cannot have initializers." v2: - Rewrite error message (Jordan) Signed-off-by: Samuel Iglesias Gonsalvez Reviewed-by: Jordan Justen --- diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index e887ac25fbb..6299bf09a1a 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2995,6 +2995,15 @@ process_initializer(ir_variable *var, ast_declaration *decl, "cannot initialize uniforms"); } + /* Section 4.3.7 "Buffer Variables" of the GLSL 4.30 spec: + * + * "Buffer variables cannot have initializers." + */ + if (var->data.mode == ir_var_shader_storage) { + _mesa_glsl_error(& initializer_loc, state, + "SSBO variables cannot have initializers"); + } + /* From section 4.1.7 of the GLSL 4.40 spec: * * "Opaque variables [...] are initialized only through the