i965: Add comments about URB size units and limits.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 12 Apr 2011 22:21:21 +0000 (15:21 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 12 Apr 2011 22:21:21 +0000 (15:21 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_vs_emit.c

index ab0c78f..f331236 100644 (file)
@@ -555,12 +555,12 @@ struct brw_context
       GLuint nr_sf_entries;
       GLuint nr_cs_entries;
 
-      /* gen6 */
+      /* gen6:
+       * The length of each URB entry owned by the VS (or GS), as
+       * a number of 1024-bit (128-byte) rows.  Should be >= 1.
+       */
       GLuint vs_size;
 /*       GLuint gs_size; */
-/*       GLuint clip_size; */
-/*       GLuint sf_size; */
-/*       GLuint cs_size; */
 
       GLuint vs_start;
       GLuint gs_start;
index acacf37..96150ec 100644 (file)
@@ -437,8 +437,14 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
       if (c->key.nr_userclip)
         header_regs += 2;
 
+      /* Each attribute is 16 bytes (1 vec4), so dividing by 8 gives us the
+       * number of 128-byte (1024-bit) units.
+       */
       c->prog_data.urb_entry_size = (attributes_in_vue + header_regs + 7) / 8;
    } else if (intel->gen == 5)
+      /* Each attribute is 16 bytes (1 vec4), so dividing by 4 gives us the
+       * number of 64-byte (512-bit) units.
+       */
       c->prog_data.urb_entry_size = (attributes_in_vue + 6 + 3) / 4;
    else
       c->prog_data.urb_entry_size = (attributes_in_vue + 2 + 3) / 4;