svga: reduce looping in svga_mark_surfaces_dirty()
authorBrian Paul <brianp@vmware.com>
Mon, 1 Aug 2016 22:30:14 +0000 (16:30 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 16 Aug 2016 14:24:52 +0000 (08:24 -0600)
We don't need to loop over the max number of color buffers, just the
current number (which is usually one).

Tested with full Piglit run, Heaven 4.0, etc.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_surface.c

index e5943cfd437720124877f5c58784ecf7b682159a..e2990630710197bc97f7ada7054d0fd068be4cc7 100644 (file)
@@ -562,7 +562,7 @@ svga_mark_surfaces_dirty(struct svga_context *svga)
    struct svga_screen *svgascreen = svga_screen(svga->pipe.screen);
    unsigned i;
 
-   for (i = 0; i < svgascreen->max_color_buffers; i++) {
+   for (i = 0; i < svga->curr.framebuffer.nr_cbufs; i++) {
       if (svga->curr.framebuffer.cbufs[i])
          svga_mark_surface_dirty(svga->curr.framebuffer.cbufs[i]);
    }