[Mesa-dev] [PATCH 27/36] i965: clip: Modify brw_clip_tri_alloc_regs() to use the VUE map.

Paul Berry stereotype441 at gmail.com
Fri Sep 2 09:07:06 PDT 2011


---
 src/mesa/drivers/dri/i965/brw_clip_tri.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c
index 0f938fe..359f76f 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_tri.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c
@@ -74,9 +74,11 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c,
       i += c->nr_regs;
    }
 
-   if (c->nr_attrs & 1) {
+   if (c->vue_map.num_slots % 2) {
+      /* The VUE has an odd number of slots so the last register is only half
+       * used.  Fill the second half with zero. */
       for (j = 0; j < 3; j++) {
-	 GLuint delta = c->offset[c->idx_to_attr[c->nr_attrs - 1]] + ATTR_SIZE;
+	 GLuint delta = c->vue_map.num_slots * ATTR_SIZE;
 
 	 brw_MOV(&c->func, byte_offset(c->reg.vertex[j], delta), brw_imm_f(0));
       }
-- 
1.7.6



More information about the mesa-dev mailing list