From: Brian Date: Fri, 23 Feb 2007 16:42:11 +0000 (-0700) Subject: Replace slang_ir_node::Target w/ Field. Remove Comment field. Clean-up. X-Git-Tag: 062012170305~19731^2~165 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75d4ed968d48d95c274a5965cc19b13a0e47ef9f;p=profile%2Fivi%2Fmesa.git Replace slang_ir_node::Target w/ Field. Remove Comment field. Clean-up. --- diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 7f4290b..2e4687a 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -348,7 +348,7 @@ _slang_alloc_statevar(slang_ir_node *n, GLuint swizzle; if (n->Opcode == IR_FIELD) { - field = n->Target; + field = n->Field; n = n->Children[0]; } diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index fb3bab4..6d6b15f 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2077,7 +2077,7 @@ _slang_gen_field(slang_assemble_ctx * A, slang_operation *oper) n = new_node1(IR_FIELD, base); if (n) { - n->Target = (char *) oper->a_id; + n->Field = (char *) oper->a_id; n->Store = _slang_new_ir_storage(base->Store->File, base->Store->Index, size); diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 6b950de..764b5f6 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -285,14 +285,14 @@ slang_print_ir(const slang_ir_node *n, int indent) slang_print_ir(n->Children[0], indent + 3); break; case IR_JUMP: - printf("JUMP %s\n", n->Target); + printf("JUMP %s\n", n->Label->Name); break; case IR_CJUMP0: - printf("CJUMP0 %s\n", n->Target); + printf("CJUMP0 %s\n", n->Label->Name); slang_print_ir(n->Children[0], indent+3); break; case IR_CJUMP1: - printf("CJUMP1 %s\n", n->Target); + printf("CJUMP1 %s\n", n->Label->Name); slang_print_ir(n->Children[0], indent+3); break; @@ -365,7 +365,7 @@ slang_print_ir(const slang_ir_node *n, int indent) (void*) n->Store); break; case IR_FIELD: - printf("FIELD %s of\n", n->Target); + printf("FIELD %s of\n", n->Field); slang_print_ir(n->Children[0], indent+3); break; case IR_FLOAT: @@ -842,7 +842,6 @@ emit_negation(slang_var_table *vt, slang_ir_node *n, struct gl_program *prog) storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask); storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store); inst->SrcReg[0].NegateBase = NEGATE_XYZW; - inst->Comment = n->Comment; return inst; } diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index ba8b613..cd1f606 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -147,13 +147,14 @@ typedef struct slang_ir_node_ { slang_ir_opcode Opcode; struct slang_ir_node_ *Children[3]; - const char *Comment; - const char *Target; /**< Branch target string */ + slang_ir_storage *Store; /**< location of result of this operation */ + GLint InstLocation; /**< Location of instruction emitted for this node */ + + /** special fields depending on Opcode: */ + const char *Field; /**< If Opcode == IR_FIELD */ GLuint Writemask; /**< If Opcode == IR_MOVE */ GLfloat Value[4]; /**< If Opcode == IR_FLOAT */ slang_variable *Var; /**< If Opcode == IR_VAR or IR_VAR_DECL */ - slang_ir_storage *Store; /**< location of result of this operation */ - GLint InstLocation; /**< Location of instruction emitted for this node */ struct slang_ir_node_ *BranchNode; /**< Used for branching instructions */ slang_label *Label; /**< Used for branches */ } slang_ir_node;