i965: SF: Remove unnecessary variables.
authorPaul Berry <stereotype441@gmail.com>
Thu, 25 Aug 2011 02:04:31 +0000 (19:04 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 6 Sep 2011 18:04:53 +0000 (11:04 -0700)
This patch removes the variables nr_attrs and nr_setup_attrs, whose
purpose is now being served by the VUE map.  nr_attr_regs and
nr_setup_regs are still needed, however they are now computed using
the VUE map rather than by counting the number of vertex shader
outputs (which caused subtle bugs when gl_PointSize was written).

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_sf.c
src/mesa/drivers/dri/i965/brw_sf.h

index ecbc9fdbc44173ef2ba35b1040aff25a9d23ae0e..e9cd020970ebc67c3ba3e3264ae8c518f3423076 100644 (file)
@@ -63,13 +63,11 @@ static void compile_sf_prog( struct brw_context *brw,
    brw_init_compile(brw, &c.func, mem_ctx);
 
    c.key = *key;
-   c.nr_attrs = brw_count_bits(c.key.attrs);
-   c.nr_attr_regs = (c.nr_attrs+1)/2;
-   c.nr_setup_attrs = brw_count_bits(c.key.attrs);
-   c.nr_setup_regs = (c.nr_setup_attrs+1)/2;
    brw_compute_vue_map(&c.vue_map, intel, c.key.nr_userclip,
                        c.key.do_twoside_color, c.key.attrs);
    c.urb_entry_read_offset = brw_sf_compute_urb_entry_read_offset(intel);
+   c.nr_attr_regs = (c.vue_map.num_slots + 1)/2 - c.urb_entry_read_offset;
+   c.nr_setup_regs = c.nr_attr_regs;
 
    c.prog_data.urb_read_length = c.nr_attr_regs;
    c.prog_data.urb_entry_size = c.nr_setup_regs * 2;
index d8af68c6b8df2dd1cc9f164670efa63186df27d0..f39ad27154d692a30a8c5d67bb3e27cdf6ad717a 100644 (file)
@@ -90,9 +90,7 @@ struct brw_sf_compile {
    struct brw_reg m3C0;
 
    GLuint nr_verts;
-   GLuint nr_attrs;
    GLuint nr_attr_regs;
-   GLuint nr_setup_attrs;
    GLuint nr_setup_regs;
    int urb_entry_read_offset;