From 9949d2a2511564226e0d68d303a53cf7d80f0c2b Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Thu, 7 Apr 2011 15:44:24 -0700 Subject: [PATCH] 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 --- src/mesa/drivers/dri/i965/brw_vtbl.c | 10 ++++------ 1 file 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 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); + } } -- 2.30.2