summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-01-08 13:09:47 -0700
committerBrian <brian@yutani.localnet.net>2007-01-08 13:09:47 -0700
commitcf4d4342c905c9989abb2dcc5e38968db8aeaf57 (patch)
tree3546ff2f67cad55cfe67fcdfbfe4314cefffbd86 /src/mesa/shader/slang/slang_compile.c
parent5cf7326132a37f11357b5cb31bcc9238fef5b54c (diff)
Checkpoint: re-org of (global) variable allocation code. More to come...
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 711849d72f..efb23255f9 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -233,6 +233,7 @@ typedef struct slang_parse_ctx_
int parsing_builtin;
GLboolean global_scope; /**< Is object being declared a global? */
slang_atom_pool *atoms;
+ slang_unit_type type; /**< Vertex vs. Fragment */
} slang_parse_ctx;
/* slang_output_ctx */
@@ -1718,8 +1719,8 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
}
#if 1
- if (C->global_scope && O->program)
- _slang_codegen_global_variable(var, O->program);
+ if (C->global_scope /*&& O->program*/)
+ _slang_codegen_global_variable(var, O->program, C->type);
#endif
/* allocate global address space for a variable with a known size */
@@ -1992,6 +1993,7 @@ compile_binary(const byte * prod, slang_code_unit * unit,
C.parsing_builtin = (builtin == NULL);
C.global_scope = GL_TRUE;
C.atoms = &unit->object->atompool;
+ C.type = type;
if (!check_revision(&C))
return GL_FALSE;