diff options
author | Brian Paul <[email protected]> | 2009-12-29 10:11:26 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-12-29 10:11:29 -0700 |
commit | 4f481cb87ae948852effde2fa4d997c007afd99c (patch) | |
tree | f7496df247793500a446e98afaffb3ce9bedb3b0 /src/mesa/shader/slang/slang_codegen.c | |
parent | 639e7a140e430aa8839c652459eddc9a4b79f9c6 (diff) |
glsl: added uniform initializer check
GLSL 1.10 disallows initializers for uniforms but GLSL 1.20 and later
allows them. This patch uses the #version directive to allow/disallow
uniform initializers.
This addresses bug 25807, but piglit also needs to be fixed to specify
the GLSL version in the shader.
Diffstat (limited to 'src/mesa/shader/slang/slang_codegen.c')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ee5a50ca82e..b62cfc36af1 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3763,6 +3763,14 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var, #endif } + if (var->type.qualifier == SLANG_QUAL_UNIFORM && + !A->allow_uniform_initializers) { + slang_info_log_error(A->log, + "initializer for uniform %s not allowed", + varName); + return NULL; + } + /* IR for the variable we're initializing */ varRef = new_var(A, var); if (!varRef) { |