Mesa (i965g-restart): i965g: remove redundant nr_attrs member

Keith Whitwell keithw at kemper.freedesktop.org
Mon Nov 30 15:38:50 UTC 2009


Module: Mesa
Branch: i965g-restart
Commit: 4490122d0cae360d1552cea7d7d860de352f13f6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4490122d0cae360d1552cea7d7d860de352f13f6

Author: Keith Whitwell <keithw at vmware.com>
Date:   Wed Nov 25 23:02:46 2009 +0000

i965g: remove redundant nr_attrs member

---

 src/gallium/drivers/i965/brw_clip.c      |    8 ++------
 src/gallium/drivers/i965/brw_clip.h      |    4 ++--
 src/gallium/drivers/i965/brw_clip_tri.c  |    6 +++---
 src/gallium/drivers/i965/brw_clip_util.c |    2 +-
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/i965/brw_clip.c b/src/gallium/drivers/i965/brw_clip.c
index 4ec7b82..58d9e56 100644
--- a/src/gallium/drivers/i965/brw_clip.c
+++ b/src/gallium/drivers/i965/brw_clip.c
@@ -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;
 
diff --git a/src/gallium/drivers/i965/brw_clip.h b/src/gallium/drivers/i965/brw_clip.h
index 8729efa..80e3a11 100644
--- a/src/gallium/drivers/i965/brw_clip.h
+++ b/src/gallium/drivers/i965/brw_clip.h
@@ -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;
 
diff --git a/src/gallium/drivers/i965/brw_clip_tri.c b/src/gallium/drivers/i965/brw_clip_tri.c
index fa00f60..4cde729 100644
--- a/src/gallium/drivers/i965/brw_clip_tri.c
+++ b/src/gallium/drivers/i965/brw_clip_tri.c
@@ -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));
       }
diff --git a/src/gallium/drivers/i965/brw_clip_util.c b/src/gallium/drivers/i965/brw_clip_util.c
index 872042c..97a5710 100644
--- a/src/gallium/drivers/i965/brw_clip_util.c
+++ b/src/gallium/drivers/i965/brw_clip_util.c
@@ -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)




More information about the mesa-commit mailing list