i915: Remove most of the code under gen >= 4 checks.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_sf_emit.c
index 7f254cfc8788a559931c96696c9a5112023aa64d..579adb68acb71003fb0b653457bdb5af7a9b6eb2 100644 (file)
 
 
 /**
- * Determine the vert_result corresponding to the given half of the given
+ * Determine the varying corresponding to the given half of the given
  * register.  half=0 means the first half of a register, half=1 means the
  * second half.
  */
-static inline int vert_reg_to_vert_result(struct brw_sf_compile *c, GLuint reg,
-                                          int half)
+static inline int vert_reg_to_varying(struct brw_sf_compile *c, GLuint reg,
+                                      int half)
 {
    int vue_slot = (reg + c->urb_entry_read_offset) * 2 + half;
-   return c->vue_map.slot_to_vert_result[vue_slot];
+   return c->vue_map.slot_to_varying[vue_slot];
 }
 
 /**
- * Determine the register corresponding to the given vert_result.
+ * Determine the register corresponding to the given varying.
  */
-static struct brw_reg get_vert_result(struct brw_sf_compile *c,
-                                      struct brw_reg vert,
-                                      GLuint vert_result)
+static struct brw_reg get_varying(struct brw_sf_compile *c,
+                                  struct brw_reg vert,
+                                  GLuint varying)
 {
-   int vue_slot = c->vue_map.vert_result_to_slot[vert_result];
+   int vue_slot = c->vue_map.varying_to_slot[varying];
    assert (vue_slot >= c->urb_entry_read_offset);
    GLuint off = vue_slot / 2 - c->urb_entry_read_offset;
    GLuint sub = vue_slot % 2;
@@ -89,8 +89,8 @@ static void copy_bfc( struct brw_sf_compile *c,
       if (have_attr(c, VARYING_SLOT_COL0+i) &&
          have_attr(c, VARYING_SLOT_BFC0+i))
         brw_MOV(p, 
-                get_vert_result(c, vert, VARYING_SLOT_COL0+i),
-                get_vert_result(c, vert, VARYING_SLOT_BFC0+i));
+                get_varying(c, vert, VARYING_SLOT_COL0+i),
+                get_varying(c, vert, VARYING_SLOT_BFC0+i));
    }
 }
 
@@ -151,8 +151,8 @@ static void copy_colors( struct brw_sf_compile *c,
    for (i = VARYING_SLOT_COL0; i <= VARYING_SLOT_COL1; i++) {
       if (have_attr(c,i))
         brw_MOV(p, 
-                get_vert_result(c, dst, i),
-                get_vert_result(c, src, i));
+                get_varying(c, dst, i),
+                get_varying(c, src, i));
    }
 }
 
@@ -350,21 +350,21 @@ calculate_masks(struct brw_sf_compile *c,
    *pc_linear = 0;
    *pc = 0xf;
       
-   if (persp_mask & BITFIELD64_BIT(vert_reg_to_vert_result(c, reg, 0)))
+   if (persp_mask & BITFIELD64_BIT(vert_reg_to_varying(c, reg, 0)))
       *pc_persp = 0xf;
 
-   if (linear_mask & BITFIELD64_BIT(vert_reg_to_vert_result(c, reg, 0)))
+   if (linear_mask & BITFIELD64_BIT(vert_reg_to_varying(c, reg, 0)))
       *pc_linear = 0xf;
 
    /* Maybe only processs one attribute on the final round:
     */
-   if (vert_reg_to_vert_result(c, reg, 1) != BRW_VARYING_SLOT_MAX) {
+   if (vert_reg_to_varying(c, reg, 1) != BRW_VARYING_SLOT_COUNT) {
       *pc |= 0xf0;
 
-      if (persp_mask & BITFIELD64_BIT(vert_reg_to_vert_result(c, reg, 1)))
+      if (persp_mask & BITFIELD64_BIT(vert_reg_to_varying(c, reg, 1)))
         *pc_persp |= 0xf0;
 
-      if (linear_mask & BITFIELD64_BIT(vert_reg_to_vert_result(c, reg, 1)))
+      if (linear_mask & BITFIELD64_BIT(vert_reg_to_varying(c, reg, 1)))
         *pc_linear |= 0xf0;
    }
 
@@ -377,24 +377,24 @@ calculate_masks(struct brw_sf_compile *c,
 static uint16_t
 calculate_point_sprite_mask(struct brw_sf_compile *c, GLuint reg)
 {
-   int vert_result1, vert_result2;
+   int varying1, varying2;
    uint16_t pc = 0;
 
-   vert_result1 = vert_reg_to_vert_result(c, reg, 0);
-   if (vert_result1 >= VARYING_SLOT_TEX0 && vert_result1 <= VARYING_SLOT_TEX7) {
-      if (c->key.point_sprite_coord_replace & (1 << (vert_result1 - VARYING_SLOT_TEX0)))
+   varying1 = vert_reg_to_varying(c, reg, 0);
+   if (varying1 >= VARYING_SLOT_TEX0 && varying1 <= VARYING_SLOT_TEX7) {
+      if (c->key.point_sprite_coord_replace & (1 << (varying1 - VARYING_SLOT_TEX0)))
         pc |= 0x0f;
    }
-   if (vert_result1 == BRW_VARYING_SLOT_PNTC)
+   if (varying1 == BRW_VARYING_SLOT_PNTC)
       pc |= 0x0f;
 
-   vert_result2 = vert_reg_to_vert_result(c, reg, 1);
-   if (vert_result2 >= VARYING_SLOT_TEX0 && vert_result2 <= VARYING_SLOT_TEX7) {
-      if (c->key.point_sprite_coord_replace & (1 << (vert_result2 -
+   varying2 = vert_reg_to_varying(c, reg, 1);
+   if (varying2 >= VARYING_SLOT_TEX0 && varying2 <= VARYING_SLOT_TEX7) {
+      if (c->key.point_sprite_coord_replace & (1 << (varying2 -
                                                      VARYING_SLOT_TEX0)))
          pc |= 0xf0;
    }
-   if (vert_result2 == BRW_VARYING_SLOT_PNTC)
+   if (varying2 == BRW_VARYING_SLOT_PNTC)
       pc |= 0xf0;
 
    return pc;