Mesa (master): intel: Fall back on any rendering to texture with no miptree .

Eric Anholt anholt at kemper.freedesktop.org
Thu May 21 17:48:29 UTC 2009


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed May 20 14:16:34 2009 -0700

intel: Fall back on any rendering to texture with no miptree.

Fixes segfault on an fbo.c negative test for FBO with texture width/height
of 0.  Previously we just tested for border != 0 to work around this
segfault.

---

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

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 0b0f0f9..04723a2 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -574,9 +574,10 @@ intel_render_texture(GLcontext * ctx,
 
    ASSERT(newImage);
 
-   if (newImage->Border != 0) {
-      /* Fallback on drawing to a texture with a border, which won't have a
-       * miptree.
+   intel_image = intel_texture_image(newImage);
+   if (!intel_image->mt) {
+      /* Fallback on drawing to a texture that doesn't have a miptree
+       * (has a border, width/height 0, etc.)
        */
       _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
       _mesa_render_texture(ctx, fb, att);
@@ -607,7 +608,6 @@ intel_render_texture(GLcontext * ctx,
        irb->Base.RefCount);
 
    /* point the renderbufer's region to the texture image region */
-   intel_image = intel_texture_image(newImage);
    if (irb->region != intel_image->mt->region) {
       if (irb->region)
 	 intel_region_release(&irb->region);




More information about the mesa-commit mailing list