Replace slang_ir_node::Target w/ Field. Remove Comment field. Clean-up.
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user