summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-11-21 14:24:28 -0700
committerBrian Paul <brian.paul@tungstengraphics.com>2008-11-24 13:11:05 -0700
commitca142c2c0841f205b9224ad719c1b01c2303b5a3 (patch)
treef32b8f168bae2d4fd5037bc9c1f889e3743f2d10 /src/mesa/shader
parent80301866f613960850ebd872a08e8fb03c4760c1 (diff)
mesa: better variable name: s/aux/store/
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c14
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.c2
-rw-r--r--src/mesa/shader/slang/slang_compile_variable.h5
-rw-r--r--src/mesa/shader/slang/slang_emit.c2
-rw-r--r--src/mesa/shader/slang/slang_vartable.c4
5 files changed, 15 insertions, 12 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 851335d9c5..882a6534e5 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -238,9 +238,9 @@ _slang_attach_storage(slang_ir_node *n, slang_variable *var)
if (!n->Store) {
/* need to setup storage */
- if (n->Var && n->Var->aux) {
+ if (n->Var && n->Var->store) {
/* node storage info = var storage info */
- n->Store = (slang_ir_storage *) n->Var->aux;
+ n->Store = n->Var->store;
}
else {
/* alloc new storage info */
@@ -251,8 +251,8 @@ _slang_attach_storage(slang_ir_node *n, slang_variable *var)
(void*) n->Store, n->Store->Size);
#endif
if (n->Var)
- n->Var->aux = n->Store;
- assert(n->Var->aux);
+ n->Var->store = n->Store;
+ assert(n->Var->store);
}
}
}
@@ -2430,8 +2430,8 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
n = new_node0(IR_VAR_DECL);
if (n) {
_slang_attach_storage(n, var);
- assert(var->aux);
- assert(n->Store == var->aux);
+ assert(var->store);
+ assert(n->Store == var->store);
assert(n->Store);
assert(n->Store->Index < 0);
@@ -3890,7 +3890,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
store ? store->Index : -2);
if (store)
- var->aux = store; /* save var's storage info */
+ var->store = store; /* save var's storage info */
var->declared = GL_TRUE;
diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c
index 3428b49e16..37fb2eedb1 100644
--- a/src/mesa/shader/slang/slang_compile_variable.c
+++ b/src/mesa/shader/slang/slang_compile_variable.c
@@ -266,7 +266,7 @@ slang_variable_construct(slang_variable * var)
var->address = ~0;
var->size = 0;
var->isTemp = GL_FALSE;
- var->aux = NULL;
+ var->store = NULL;
var->declared = 0;
return 1;
}
diff --git a/src/mesa/shader/slang/slang_compile_variable.h b/src/mesa/shader/slang/slang_compile_variable.h
index c6db16fcfa..8e30728ab8 100644
--- a/src/mesa/shader/slang/slang_compile_variable.h
+++ b/src/mesa/shader/slang/slang_compile_variable.h
@@ -30,6 +30,9 @@ extern "C" {
#endif
+struct slang_ir_storage_;
+
+
typedef enum slang_type_variant_
{
SLANG_VARIANT, /* the default */
@@ -107,7 +110,7 @@ typedef struct slang_variable_
GLuint size; /**< Variable's size in bytes */
GLboolean isTemp; /**< a named temporary (__resultTmp) */
GLboolean declared; /**< for debug */
- void *aux; /**< Used during code gen */
+ struct slang_ir_storage_ *store; /**< Storage for this var */
} slang_variable;
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 0a3ab39eb1..f31e9b4e6c 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -2025,7 +2025,7 @@ emit_var_decl(slang_emit_info *emitInfo, slang_ir_node *n)
printf("IR_VAR_DECL %s %d store %p\n",
(char*) n->Var->a_name, n->Store->Index, (void*) n->Store);
*/
- assert(n->Var->aux == n->Store);
+ assert(n->Var->store == n->Store);
}
if (emitInfo->EmitComments) {
/* emit NOP with comment describing the variable's storage location */
diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c
index 95971a70a9..de0c93957b 100644
--- a/src/mesa/shader/slang/slang_vartable.c
+++ b/src/mesa/shader/slang/slang_vartable.c
@@ -107,7 +107,7 @@ _slang_pop_var_table(slang_var_table *vt)
/* free the storage allocated for each variable */
for (i = 0; i < t->NumVars; i++) {
- slang_ir_storage *store = (slang_ir_storage *) t->Vars[i]->aux;
+ slang_ir_storage *store = t->Vars[i]->store;
GLint j;
GLuint comp;
if (dbg) printf(" Free var %s, size %d at %d.%s\n",
@@ -165,7 +165,7 @@ _slang_add_variable(slang_var_table *vt, slang_variable *v)
assert(vt);
t = vt->Top;
assert(t);
- if (dbg) printf("Adding var %s, store %p\n", (char *) v->a_name, v->aux);
+ if (dbg) printf("Adding var %s, store %p\n", (char *) v->a_name, (void *) v->store);
t->Vars = (slang_variable **)
_slang_realloc(t->Vars,
t->NumVars * sizeof(slang_variable *),