Mesa (master): i965: Remove the forced lack of caching for renderbuffer surface state.

Eric Anholt anholt at kemper.freedesktop.org
Wed May 6 17:58:12 UTC 2009


Module: Mesa
Branch: master
Commit: f831d2d41b5551abcf61f19880bc96779c5efd51
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f831d2d41b5551abcf61f19880bc96779c5efd51

Author: Eric Anholt <eric at anholt.net>
Date:   Wed May  6 10:51:58 2009 -0700

i965: Remove the forced lack of caching for renderbuffer surface state.

This snuck in with the multi-draw-buffers commit, and is a major penalty
to performance.  It doesn't appear to be required, as the only dependency
the surface BO has is on the state key (and if there's some other dependency,
it should just be in the key).

This brings openarena performance up to almost 2% faster than Mesa 7.4.

---

 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index f2d9541..c49a5f6 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -505,7 +505,7 @@ const struct brw_tracked_state brw_wm_constant_surface = {
 static void
 brw_update_renderbuffer_surface(struct brw_context *brw,
 				struct gl_renderbuffer *rb,
-				unsigned int unit, GLboolean cached)
+				unsigned int unit)
 {
    GLcontext *ctx = &brw->intel.ctx;
    dri_bo *region_bo = NULL;
@@ -565,13 +565,11 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
 		      ctx->Color.BlendEnabled);
 
    dri_bo_unreference(brw->wm.surf_bo[unit]);
-   brw->wm.surf_bo[unit] = NULL;
-   if (cached) 
-       brw->wm.surf_bo[unit] = brw_search_cache(&brw->surface_cache,
-                                                BRW_SS_SURFACE,
-                                                &key, sizeof(key),
-                                                &region_bo, 1,
-                                                NULL);
+   brw->wm.surf_bo[unit] = brw_search_cache(&brw->surface_cache,
+					    BRW_SS_SURFACE,
+					    &key, sizeof(key),
+					    &region_bo, 1,
+					    NULL);
 
    if (brw->wm.surf_bo[unit] == NULL) {
       struct brw_surface_state surf;
@@ -682,11 +680,10 @@ static void prepare_wm_surfaces(struct brw_context *brw )
       for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
          brw_update_renderbuffer_surface(brw,
 					 ctx->DrawBuffer->_ColorDrawBuffers[i],
-					 i,
-					 GL_FALSE);
+					 i);
       }
    } else {
-      brw_update_renderbuffer_surface(brw, NULL, 0, GL_TRUE);
+      brw_update_renderbuffer_surface(brw, NULL, 0);
    }
 
    old_nr_surfaces = brw->wm.nr_surfaces;




More information about the mesa-commit mailing list