From: Chad Versace Date: Thu, 7 Apr 2011 22:44:24 +0000 (-0700) Subject: i965: Remove unnecessary release/reference of brw_context.state.depth_region X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9949d2a2511564226e0d68d303a53cf7d80f0c2b;p=mesa.git 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 Signed-off-by: Chad Versace --- diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 152ee141568..ce8712a260f 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); + } }