aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-29 10:11:26 -0700
committerBrian Paul <[email protected]>2009-12-29 10:11:29 -0700
commit4f481cb87ae948852effde2fa4d997c007afd99c (patch)
treef7496df247793500a446e98afaffb3ce9bedb3b0 /src/mesa/shader/slang/slang_compile.c
parent639e7a140e430aa8839c652459eddc9a4b79f9c6 (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_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 499e16e2de9..57e3555c221 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -2058,6 +2058,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
if (C->global_scope) {
slang_assemble_ctx A;
memset(&A, 0, sizeof(slang_assemble_ctx));
+ A.allow_uniform_initializers = C->version > 110;
A.atoms = C->atoms;
A.space.funcs = O->funs;
A.space.structs = O->structs;
@@ -2077,6 +2078,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
if (var->initializer != NULL) {
slang_assemble_ctx A;
memset(&A, 0, sizeof(slang_assemble_ctx));
+ A.allow_uniform_initializers = C->version > 110;
A.atoms = C->atoms;
A.space.funcs = O->funs;
A.space.structs = O->structs;
@@ -2434,6 +2436,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit,
A.vartable = o.vartable;
A.EmitContReturn = ctx->Shader.EmitContReturn;
A.log = C->L;
+ A.allow_uniform_initializers = C->version > 110;
/* main() takes no parameters */
if (mainFunc->param_count > 0) {