From e29cff62734b6aaf0b05dba0b3ed98fe78842a42 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Jul 2010 16:11:19 -0700 Subject: [PATCH] i965: Clarify the nr_regs calculation in brw_clip.c --- src/mesa/drivers/dri/i965/brw_clip.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 228ee3f3be1..96d278f1703 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -83,11 +83,16 @@ static void compile_clip_prog( struct brw_context *brw, } c.nr_attrs = brw_count_bits(c.key.attrs); - + + /* The vertex attributes start at a URB row-aligned offset after + * the 8-20 dword vertex header, and continue for a URB row-aligned + * length. nr_regs determines the urb_read_length from the start + * of the header to the end of the vertex data. + */ if (intel->gen == 5) - c.nr_regs = (c.nr_attrs + 1) / 2 + 3; /* are vertices packed, or reg-aligned? */ + c.nr_regs = 3 + (c.nr_attrs + 1) / 2; else - c.nr_regs = (c.nr_attrs + 1) / 2 + 1; /* are vertices packed, or reg-aligned? */ + c.nr_regs = 1 + (c.nr_attrs + 1) / 2; c.nr_bytes = c.nr_regs * REG_SIZE; -- 2.30.2