intel: Remove gratuitous context checks in intel_delete_renderbuffer().
authorEric Anholt <eric@anholt.net>
Wed, 29 Jun 2011 18:37:35 +0000 (11:37 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 7 Jul 2011 21:43:44 +0000 (14:43 -0700)
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@chad-versace.us>
src/mesa/drivers/dri/intel/intel_fbo.c

index 124600200904e8690130dd9b1aa74779e19fef1a..1669af2c2a7e1d25b2171974b5d728cfa1cf9288 100644 (file)
@@ -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);
 }