i965/fs: Reindent register offset calculation of try_copy_propagate().
[mesa.git] / src / mesa / drivers / dri / i965 / brw_clip_tri.c
index d4babc933139e16da4bbff5edfa0ac831024942a..0bac76096f8f0353fac2b86f238999a6bda80d32 100644 (file)
@@ -29,7 +29,6 @@
   *   Keith Whitwell <keithw@vmware.com>
   */
 
-#include "main/glheader.h"
 #include "main/macros.h"
 #include "main/enums.h"
 #include "program/program.h"
@@ -50,7 +49,7 @@ static void release_tmps( struct brw_clip_compile *c )
 void brw_clip_tri_alloc_regs( struct brw_clip_compile *c,
                              GLuint nr_verts )
 {
-   struct brw_context *brw = c->func.brw;
+   const struct brw_device_info *devinfo = c->func.devinfo;
    GLuint i = 0,j;
 
    /* Register usage is static, precompute here:
@@ -123,7 +122,7 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c,
    c->reg.clipdistance_offset = retype(brw_vec1_grf(i, 1), BRW_REGISTER_TYPE_W);
    i++;
 
-   if (brw->gen == 5) {
+   if (devinfo->gen == 5) {
       c->reg.ff_sync = retype(brw_vec1_grf(i, 0), BRW_REGISTER_TYPE_UD);
       i++;
    }
@@ -139,7 +138,7 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c,
 
 void brw_clip_tri_init_vertices( struct brw_clip_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */
 
    /* Initial list of indices for incoming vertexes:
@@ -179,7 +178,7 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c )
 
 void brw_clip_tri_flat_shade( struct brw_clip_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */
 
    brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK));
@@ -234,7 +233,7 @@ static inline void
 load_clip_distance(struct brw_clip_compile *c, struct brw_indirect vtx,
                 struct brw_reg dst, GLuint hpos_offset, int cond)
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
 
    dst = vec4(dst);
    brw_AND(p, vec1(brw_null_reg()), c->reg.vertex_src_mask, brw_imm_ud(1));
@@ -260,7 +259,7 @@ load_clip_distance(struct brw_clip_compile *c, struct brw_indirect vtx,
  */
 void brw_clip_tri( struct brw_clip_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    struct brw_indirect vtx = brw_indirect(0, 0);
    struct brw_indirect vtxPrev = brw_indirect(1, 0);
    struct brw_indirect vtxOut = brw_indirect(2, 0);
@@ -307,7 +306,7 @@ void brw_clip_tri( struct brw_clip_compile *c )
            brw_MOV(p, c->reg.plane_equation, deref_4f(plane_ptr, 0));
         else
            brw_MOV(p, c->reg.plane_equation, deref_4b(plane_ptr, 0));
-       
+
         brw_MOV(p, c->reg.loopcount, c->reg.nr_verts);
         brw_MOV(p, c->reg.nr_verts, brw_imm_ud(0));
 
@@ -352,7 +351,7 @@ void brw_clip_tri( struct brw_clip_compile *c )
                  brw_MOV(p, get_addr_reg(vtxOut), brw_imm_uw(0) );
               }
               brw_ENDIF(p);
-       
+
            }
            brw_ELSE(p);
            {
@@ -392,11 +391,11 @@ void brw_clip_tri( struct brw_clip_compile *c )
                  brw_ADD(p, get_addr_reg(outlist_ptr), get_addr_reg(outlist_ptr), brw_imm_uw(sizeof(short)));
                  brw_ADD(p, c->reg.nr_verts, c->reg.nr_verts, brw_imm_ud(1));
                  brw_MOV(p, get_addr_reg(vtxOut), brw_imm_uw(0) );
-              }        
+              }
               brw_ENDIF(p);
            }
            brw_ENDIF(p);
-       
+
            /* vtxPrev = vtx;
             * inlist_ptr++;
             */
@@ -452,7 +451,7 @@ void brw_clip_tri( struct brw_clip_compile *c )
 
 void brw_clip_tri_emit_polygon(struct brw_clip_compile *c)
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
 
    /* for (loopcount = nr_verts-2; loopcount > 0; loopcount--)
     */
@@ -508,7 +507,7 @@ static void do_clip_tri( struct brw_clip_compile *c )
 
 static void maybe_do_clip_tri( struct brw_clip_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
 
    brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_NZ, c->reg.planemask, brw_imm_ud(0));
    brw_IF(p, BRW_EXECUTE_1);
@@ -533,7 +532,7 @@ static void brw_clip_test( struct brw_clip_compile *c )
     struct brw_indirect vt1 = brw_indirect(1, 0);
     struct brw_indirect vt2 = brw_indirect(2, 0);
 
-    struct brw_compile *p = &c->func;
+    struct brw_codegen *p = &c->func;
     struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */
 
     GLuint hpos_offset = brw_varying_to_offset(&c->vue_map,
@@ -629,7 +628,7 @@ static void brw_clip_test( struct brw_clip_compile *c )
 
 void brw_emit_tri_clip( struct brw_clip_compile *c )
 {
-   struct brw_compile *p = &c->func;
+   struct brw_codegen *p = &c->func;
    brw_clip_tri_alloc_regs(c, 3 + c->key.nr_userclip + 6);
    brw_clip_tri_init_vertices(c);
    brw_clip_init_clipmask(c);