i965g: fix order of calculation of brw->wm.nr_surfaces
authorKeith Whitwell <keithw@vmware.com>
Wed, 4 Nov 2009 23:41:30 +0000 (23:41 +0000)
committerKeith Whitwell <keithw@vmware.com>
Wed, 4 Nov 2009 23:41:30 +0000 (23:41 +0000)
src/gallium/drivers/i965/brw_wm_surface_state.c

index 6c29db045fc1272bc204dba5a39dabd4031f5c47..b055dde20cf1ceee29f56f53e92b4b2aa3f48d3e 100644 (file)
@@ -215,14 +215,14 @@ static int prepare_wm_surfaces(struct brw_context *brw )
    }
 #endif
 
-   brw->sws->bo_unreference(brw->wm.bind_bo);
-   brw->wm.bind_bo = brw_wm_get_binding_table(brw);
-
    if (brw->wm.nr_surfaces != nr_surfaces) {
       brw->wm.nr_surfaces = nr_surfaces;
       brw->state.dirty.brw |= BRW_NEW_NR_WM_SURFACES;
    }
 
+   brw->sws->bo_unreference(brw->wm.bind_bo);
+   brw->wm.bind_bo = brw_wm_get_binding_table(brw);
+
    return 0;
 }