i965g: remove redundant nr_attrs member
authorKeith Whitwell <keithw@vmware.com>
Wed, 25 Nov 2009 23:02:46 +0000 (23:02 +0000)
committerKeith Whitwell <keithw@vmware.com>
Mon, 30 Nov 2009 15:37:27 +0000 (15:37 +0000)
src/gallium/drivers/i965/brw_clip.c
src/gallium/drivers/i965/brw_clip.h
src/gallium/drivers/i965/brw_clip_tri.c
src/gallium/drivers/i965/brw_clip_util.c

index 4ec7b82..58d9e56 100644 (file)
@@ -81,10 +81,6 @@ compile_clip_prog( struct brw_context *brw,
    else
        delta = REG_SIZE;
 
-   /* XXX: c.nr_attrs is very redundant:
-    */
-   c.nr_attrs = c.key.nr_attrs;
-
    c.offset_hpos = delta + c.key.output_hpos * ATTR_SIZE;
 
    if (c.key.output_color0)
@@ -103,9 +99,9 @@ compile_clip_prog( struct brw_context *brw,
       c.offset_edgeflag = delta + c.key.output_edgeflag * ATTR_SIZE;
    
    if (BRW_IS_IGDNG(brw))
-       c.nr_regs = (c.nr_attrs + 1) / 2 + 3;  /* are vertices packed, or reg-aligned? */
+       c.nr_regs = (c.key.nr_attrs + 1) / 2 + 3;  /* are vertices packed, or reg-aligned? */
    else
-       c.nr_regs = (c.nr_attrs + 1) / 2 + 1;  /* are vertices packed, or reg-aligned? */
+       c.nr_regs = (c.key.nr_attrs + 1) / 2 + 1;  /* are vertices packed, or reg-aligned? */
 
    c.nr_bytes = c.nr_regs * REG_SIZE;
 
index 8729efa..80e3a11 100644 (file)
@@ -115,9 +115,9 @@ struct brw_clip_compile {
       struct brw_reg ff_sync;
    } reg;
 
-   /* 3 different ways of expressing vertex size:
+   /* 3 different ways of expressing vertex size, including
+    * key.nr_attrs.
     */
-   GLuint nr_attrs;
    GLuint nr_regs;
    GLuint nr_bytes;
 
index fa00f60..4cde729 100644 (file)
@@ -66,12 +66,12 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c,
       i += c->nr_regs;
    }
 
-   if (c->nr_attrs & 1) {
+   if (c->key.nr_attrs & 1) {
       for (j = 0; j < 3; j++) {
-        GLuint delta = c->nr_attrs*16 + 32;
+        GLuint delta = c->key.nr_attrs*16 + 32;
 
          if (c->chipset.is_igdng)
-             delta = c->nr_attrs * 16 + 32 * 3;
+             delta = c->key.nr_attrs * 16 + 32 * 3;
 
         brw_MOV(&c->func, byte_offset(c->reg.vertex[j], delta), brw_imm_f(0));
       }
index 872042c..97a5710 100644 (file)
@@ -140,7 +140,7 @@ 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 (c->chipset.is_igdng)