Replace slang_ir_node::Target w/ Field. Remove Comment field. Clean-up.
authorBrian <brian@yutani.localnet.net>
Fri, 23 Feb 2007 16:42:11 +0000 (09:42 -0700)
committerBrian <brian@yutani.localnet.net>
Fri, 23 Feb 2007 16:42:11 +0000 (09:42 -0700)
src/mesa/shader/slang/slang_builtin.c
src/mesa/shader/slang/slang_codegen.c
src/mesa/shader/slang/slang_emit.c
src/mesa/shader/slang/slang_ir.h

index 7f4290b..2e4687a 100644 (file)
@@ -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];
    }
 
index fb3bab4..6d6b15f 100644 (file)
@@ -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);
index 6b950de..764b5f6 100644 (file)
@@ -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;
 }
 
index ba8b613..cd1f606 100644 (file)
@@ -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;