Merge branch '7.8'
[mesa.git] / src / gallium / drivers / i965 / brw_vs_emit.c
index 6d8366f8624931248981f6450bc3cfb67dd8415c..5dcbd597ddcaf1860c3efada8a98d5e10ad02592 100644 (file)
@@ -79,18 +79,12 @@ static void release_tmps( struct brw_vs_compile *c )
 static boolean is_position_output( struct brw_vs_compile *c,
                                    unsigned vs_output )
 {
-   struct brw_vertex_shader *vs = c->vp;
-
-   if (vs_output == c->prog_data.output_edgeflag) {
-      return FALSE;
-   }
-   else {
-      unsigned semantic = vs->info.output_semantic_name[vs_output];
-      unsigned index = vs->info.output_semantic_index[vs_output];
+   const struct brw_vertex_shader *vs = c->vp;
+   unsigned semantic = vs->info.output_semantic_name[vs_output];
+   unsigned index = vs->info.output_semantic_index[vs_output];
       
-      return (semantic == TGSI_SEMANTIC_POSITION &&
-              index == 0);
-   }
+   return (semantic == TGSI_SEMANTIC_POSITION &&
+           index == 0);
 }
 
 
@@ -98,23 +92,16 @@ static boolean find_output_slot( struct brw_vs_compile *c,
                                   unsigned vs_output,
                                   unsigned *fs_input_slot )
 {
-   struct brw_vertex_shader *vs = c->vp;
-
-   if (vs_output == c->prog_data.output_edgeflag) {
-      *fs_input_slot = c->key.fs_signature.nr_inputs;
-      return TRUE;
-   }
-   else {
-      unsigned semantic = vs->info.output_semantic_name[vs_output];
-      unsigned index = vs->info.output_semantic_index[vs_output];
-      unsigned i;
+   const struct brw_vertex_shader *vs = c->vp;
+   unsigned semantic = vs->info.output_semantic_name[vs_output];
+   unsigned index = vs->info.output_semantic_index[vs_output];
+   unsigned i;
 
-      for (i = 0; i < c->key.fs_signature.nr_inputs; i++) {
-         if (c->key.fs_signature.input[i].semantic == semantic &&
+   for (i = 0; i < c->key.fs_signature.nr_inputs; i++) {
+      if (c->key.fs_signature.input[i].semantic == semantic &&
           c->key.fs_signature.input[i].semantic_index == index) {
-            *fs_input_slot = i;
-            return TRUE;
-         }
+         *fs_input_slot = i;
+         return TRUE;
       }
    }
 
@@ -921,6 +908,7 @@ get_constant(struct brw_vs_compile *c,
 }
 
 
+#if 0
 
 /* TODO: relative addressing!
  */
@@ -949,6 +937,8 @@ static struct brw_reg get_reg( struct brw_vs_compile *c,
    }
 }
 
+#endif
+
 
 /**
  * Indirect addressing:  get reg[[arg] + offset].
@@ -1067,22 +1057,22 @@ static struct brw_reg get_arg( struct brw_vs_compile *c,
 {
    struct brw_reg reg;
 
-   if (src->SrcRegister.File == TGSI_FILE_NULL)
+   if (src->Register.File == TGSI_FILE_NULL)
       return brw_null_reg();
 
    reg = get_src_reg(c, argIndex,
-                    src->SrcRegister.File,
-                    src->SrcRegister.Index,
-                    src->SrcRegister.Indirect);
+                    src->Register.File,
+                    src->Register.Index,
+                    src->Register.Indirect);
 
    /* Convert 3-bit swizzle to 2-bit.  
     */
-   reg.dw1.bits.swizzle = BRW_SWIZZLE4(src->SrcRegister.SwizzleX,
-                                      src->SrcRegister.SwizzleY,
-                                      src->SrcRegister.SwizzleZ,
-                                      src->SrcRegister.SwizzleW);
+   reg.dw1.bits.swizzle = BRW_SWIZZLE4(src->Register.SwizzleX,
+                                      src->Register.SwizzleY,
+                                      src->Register.SwizzleZ,
+                                      src->Register.SwizzleW);
 
-   reg.negate = src->SrcRegister.Negate ? 1 : 0;   
+   reg.negate = src->Register.Negate ? 1 : 0;   
 
    /* XXX: abs, absneg
     */
@@ -1141,12 +1131,6 @@ static void emit_vertex_write( struct brw_vs_compile *c)
    int i;
    GLuint len_vertext_header = 2;
 
-   if (c->key.copy_edgeflag) {
-      brw_MOV(p, 
-              get_reg(c, TGSI_FILE_OUTPUT, c->prog_data.output_edgeflag),
-              brw_imm_f(1));
-   }
-
    /* Build ndc coords */
    ndc = get_tmp(c);
    /* ndc = 1.0 / pos.w */
@@ -1353,7 +1337,7 @@ static void emit_insn(struct brw_vs_compile *c,
                      const struct tgsi_full_instruction *inst)
 {
    unsigned opcode = inst->Instruction.Opcode;
-   unsigned label = inst->InstructionExtLabel.Label;
+   unsigned label = inst->Label.Label;
    struct brw_compile *p = &c->func;
    struct brw_reg args[3], dst;
    GLuint i;
@@ -1366,7 +1350,7 @@ static void emit_insn(struct brw_vs_compile *c,
    /* Get argument regs.
     */
    for (i = 0; i < 3; i++) {
-      args[i] = get_arg(c, &inst->FullSrcRegisters[i], i);
+      args[i] = get_arg(c, &inst->Src[i], i);
    }
 
    /* Get dest regs.  Note that it is possible for a reg to be both
@@ -1374,9 +1358,9 @@ static void emit_insn(struct brw_vs_compile *c,
     * care needs to be taken emitting multi-operation instructions.
     */ 
    dst = get_dst(c, 
-                inst->FullDstRegisters[0].DstRegister.File,
-                inst->FullDstRegisters[0].DstRegister.Index,
-                inst->FullDstRegisters[0].DstRegister.WriteMask);
+                inst->Dst[0].Register.File,
+                inst->Dst[0].Register.Index,
+                inst->Dst[0].Register.WriteMask);
 
    /* XXX: saturate
     */
@@ -1619,7 +1603,7 @@ void brw_vs_emit(struct brw_vs_compile *c)
    struct tgsi_parse_context parse;
    struct tgsi_full_instruction *inst;
 
-//   if (BRW_DEBUG & DEBUG_VS)
+   if (BRW_DEBUG & DEBUG_VS)
       tgsi_dump(c->vp->tokens, 0); 
 
    c->stack_index = brw_indirect(0, 0);