diff options
author | Brian <[email protected]> | 2007-01-27 20:29:33 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-01-27 20:29:33 -0700 |
commit | 513325fa32f802ffb3d3c8323ecf8216782620d3 (patch) | |
tree | e6b259e04f4f3656023c8609a592b5163cb16ffa /src/mesa/shader/slang/slang_emit.c | |
parent | d6772f157a56bb53b754bb16c98e102b54c82a0e (diff) |
Clean-up of var/temp allocation function parameters.
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index c3167e36fb3..568b40997db 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -335,15 +335,11 @@ slang_print_ir(const slang_ir_node *n, int indent) static void alloc_temp_storage(slang_var_table *vt, slang_ir_node *n, GLint size) { - GLint indx; - GLuint swizzle; assert(!n->Var); assert(!n->Store); assert(size > 0); - indx = _slang_alloc_temp(vt, size, &swizzle); - n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, indx, size); - if (n->Store) - n->Store->Swizzle = swizzle; + n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, size); + (void) _slang_alloc_temp(vt, n->Store); } @@ -355,8 +351,8 @@ static void free_temp_storage(slang_var_table *vt, slang_ir_node *n) { if (n->Store->File == PROGRAM_TEMPORARY && n->Store->Index >= 0) { - if (_slang_is_temp(vt, n->Store->Index, n->Store->Swizzle)) { - _slang_free_temp(vt, n->Store->Index, n->Store->Size, n->Store->Swizzle); + if (_slang_is_temp(vt, n->Store)) { + _slang_free_temp(vt, n->Store); /* XXX free(store)? */ n->Store->Index = -1; n->Store->Size = -1; @@ -814,15 +810,12 @@ emit_move(slang_var_table *vt, slang_ir_node *n, struct gl_program *prog) emit(vt, n->Children[0], prog); #if PEEPHOLE_OPTIMIZATIONS - if (inst && _slang_is_temp(vt, n->Children[1]->Store->Index, - n->Children[1]->Store->Swizzle)) { + if (inst && _slang_is_temp(vt, n->Children[1]->Store)) { /* Peephole optimization: * Just modify the RHS to put its result into the dest of this * MOVE operation. Then, this MOVE is a no-op. */ - _slang_free_temp(vt, n->Children[1]->Store->Index, - n->Children[1]->Store->Size, - n->Children[1]->Store->Swizzle); + _slang_free_temp(vt, n->Children[1]->Store); *n->Children[1]->Store = *n->Children[0]->Store; /* fixup the prev (RHS) instruction */ assert(n->Children[0]->Store->Index >= 0); @@ -899,8 +892,7 @@ emit_cond(slang_var_table *vt, slang_ir_node *n, struct gl_program *prog) inst->CondUpdate = GL_TRUE; storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store); - _slang_free_temp(vt, n->Store->Index, n->Store->Size, - n->Store->Swizzle); + _slang_free_temp(vt, n->Store); inst->Comment = _mesa_strdup("COND expr"); return inst; /* XXX or null? */ } @@ -940,16 +932,12 @@ emit(slang_var_table *vt, slang_ir_node *n, struct gl_program *prog) assert(n->Store->Index < 0); if (!n->Var || n->Var->isTemp) { /* a nameless/temporary variable, will be freed after first use */ - GLuint swizzle; - n->Store->Index = _slang_alloc_temp(vt, n->Store->Size, &swizzle); - n->Store->Swizzle = swizzle; + (void) _slang_alloc_temp(vt, n->Store); } else { /* a regular variable */ - GLuint swizzle; _slang_add_variable(vt, n->Var); - n->Store->Index = _slang_alloc_var(vt, n->Store->Size, &swizzle); - n->Store->Swizzle = swizzle; + (void) _slang_alloc_var(vt, n->Store); /* printf("IR_VAR_DECL %s %d store %p\n", (char*) n->Var->a_name, n->Store->Index, (void*) n->Store); |