llvmpipe: Always swizzle/unswizzle whole tiles.
[mesa.git] / src / gallium / drivers / i965 / brw_clip_util.c
index 7a6c46ce0773ab887786c100b66305c7ecce8d38..23e51ee9bcde8395b266ab46bfdb080670c859ff 100644 (file)
@@ -31,9 +31,7 @@
 
 
 #include "brw_defines.h"
-#include "brw_context.h"
 #include "brw_eu.h"
-#include "brw_util.h"
 #include "brw_clip.h"
 
 
@@ -93,7 +91,7 @@ void brw_clip_project_position(struct brw_clip_compile *c, struct brw_reg pos )
    /* value.xyz *= value.rhw
     */
    brw_set_access_mode(p, BRW_ALIGN_16);
-   brw_MUL(p, brw_writemask(pos, WRITEMASK_XYZ), pos, brw_swizzle1(pos, W));
+   brw_MUL(p, brw_writemask(pos, BRW_WRITEMASK_XYZ), pos, brw_swizzle1(pos, W));
    brw_set_access_mode(p, BRW_ALIGN_1);
 }
 
@@ -107,7 +105,7 @@ static void brw_clip_project_vertex( struct brw_clip_compile *c,
    /* Fixup position.  Extract from the original vertex and re-project
     * to screen space:
     */
-   brw_MOV(p, tmp, deref_4f(vert_addr, c->offset[VERT_RESULT_HPOS]));
+   brw_MOV(p, tmp, deref_4f(vert_addr, c->offset_hpos));
    brw_clip_project_position(c, tmp);
    brw_MOV(p, deref_4f(vert_addr, c->header_position_offset), tmp);
         
@@ -141,13 +139,13 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,
       
    /* Iterate over each attribute (could be done in pairs?)
     */
-   for (i = 0; i < c->nr_attrs; i++) {
+   for (i = 0; i < c->key.nr_attrs; i++) {
       GLuint delta = i*16 + 32;
 
-      if (BRW_IS_IGDNG(p->brw))
+      if (c->chipset.is_igdng)
           delta = i * 16 + 32 * 3;
 
-      if (delta == c->offset[VERT_RESULT_EDGE]) {
+      if (delta == c->offset_edgeflag) {
         if (force_edgeflag) 
            brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(1));
         else
@@ -178,7 +176,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,
    if (i & 1) {
       GLuint delta = i*16 + 32;
 
-      if (BRW_IS_IGDNG(p->brw))
+      if (c->chipset.is_igdng)
           delta = i * 16 + 32 * 3;
 
       brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(0));
@@ -304,25 +302,25 @@ void brw_clip_copy_colors( struct brw_clip_compile *c,
 {
    struct brw_compile *p = &c->func;
 
-   if (c->offset[VERT_RESULT_COL0])
+   if (c->offset_color0)
       brw_MOV(p, 
-             byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL0]),
-             byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL0]));
+             byte_offset(c->reg.vertex[to], c->offset_color0),
+             byte_offset(c->reg.vertex[from], c->offset_color0));
 
-   if (c->offset[VERT_RESULT_COL1])
+   if (c->offset_color1)
       brw_MOV(p, 
-             byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL1]),
-             byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL1]));
+             byte_offset(c->reg.vertex[to], c->offset_color1),
+             byte_offset(c->reg.vertex[from], c->offset_color1));
 
-   if (c->offset[VERT_RESULT_BFC0])
+   if (c->offset_bfc0)
       brw_MOV(p, 
-             byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC0]),
-             byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC0]));
+             byte_offset(c->reg.vertex[to], c->offset_bfc0),
+             byte_offset(c->reg.vertex[from], c->offset_bfc0));
 
-   if (c->offset[VERT_RESULT_BFC1])
+   if (c->offset_bfc1)
       brw_MOV(p, 
-             byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC1]),
-             byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC1]));
+             byte_offset(c->reg.vertex[to], c->offset_bfc1),
+             byte_offset(c->reg.vertex[from], c->offset_bfc1));
 }