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 <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Samuel Iglesias Gonsalvez 2015-03-18 10:25:10 +01:00
parent fa0a86c057
commit 20b2907db7
1 changed files with 9 additions and 0 deletions

View File

@ -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