Mesa (master): i965: Remove unnecessary release/reference of brw_context. state.depth_region

Chad Versace chadversary at kemper.freedesktop.org
Tue Apr 12 17:56:47 PDT 2011


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

Author: Chad Versace <chad.versace at intel.com>
Date:   Thu Apr  7 15:44:24 2011 -0700

i965: Remove unnecessary release/reference of brw_context.state.depth_region

Release the old depth region and reference the new one *only* if it has
changed.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Signed-off-by: Chad Versace <chad.versace at intel.com>

---

 src/mesa/drivers/dri/i965/brw_vtbl.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index 152ee14..ce8712a 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -115,13 +115,11 @@ static void brw_set_draw_region( struct intel_context *intel,
 {
    struct brw_context *brw = brw_context(&intel->ctx);
 
-   /* release old color/depth regions */
-   if (brw->state.depth_region != depth_region)
+   if (brw->state.depth_region != depth_region) {
       brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER;
-   intel_region_release(&brw->state.depth_region);
-
-   /* reference new color/depth regions */
-   intel_region_reference(&brw->state.depth_region, depth_region);
+      intel_region_release(&brw->state.depth_region);
+      intel_region_reference(&brw->state.depth_region, depth_region);
+   }
 }
 
 



More information about the mesa-commit mailing list