Mesa (master): intel: Remove gratuitous context checks in intel_delete_renderbuffer().

Eric Anholt anholt at kemper.freedesktop.org
Thu Jul 7 21:46:31 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jun 29 11:37:35 2011 -0700

intel: Remove gratuitous context checks in intel_delete_renderbuffer().

Even if we don't have a current context, if we're freeing the rb we
should free its region (and BO).  The renderbuffer unreference checks
appear to be just cargo-cult from the region unreference code.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
Reviewed-by: Chad Versace <chad at chad-versace.us>

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 1246002..1669af2 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -70,24 +70,15 @@ intel_new_framebuffer(struct gl_context * ctx, GLuint name)
 static void
 intel_delete_renderbuffer(struct gl_renderbuffer *rb)
 {
-   GET_CURRENT_CONTEXT(ctx);
-   struct intel_context *intel = intel_context(ctx);
    struct intel_renderbuffer *irb = intel_renderbuffer(rb);
 
    ASSERT(irb);
 
-   if (intel && irb->region) {
-      intel_region_release(&irb->region);
-   }
-   if (intel && irb->hiz_region) {
-      intel_region_release(&irb->hiz_region);
-   }
-   if (intel && irb->wrapped_depth) {
-      _mesa_reference_renderbuffer(&irb->wrapped_depth, NULL);
-   }
-   if (intel && irb->wrapped_stencil) {
-      _mesa_reference_renderbuffer(&irb->wrapped_stencil, NULL);
-   }
+   intel_region_release(&irb->region);
+   intel_region_release(&irb->hiz_region);
+
+   _mesa_reference_renderbuffer(&irb->wrapped_depth, NULL);
+   _mesa_reference_renderbuffer(&irb->wrapped_stencil, NULL);
 
    free(irb);
 }




More information about the mesa-commit mailing list