Signed-off-by: Thomas Hellstrom <[email protected]>
---
 src/mesa/state_tracker/st_cb_texture.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index 15f84b6..3f76b07 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -597,7 +597,7 @@ st_TexImage(GLcontext * ctx,
 
    if (width == 0 || height == 0 || depth == 0) {
       /* stop after freeing old image */
-      return;
+      goto setup_fboinfo;
    }
 
    /* If this is the only mipmap level in the texture, could call
@@ -661,7 +661,7 @@ st_TexImage(GLcontext * ctx,
                                           pixels, unpack, "glTexImage");
    }
    if (!pixels)
-      return;
+      goto setup_fboinfo;
 
    /* See if we can do texture compression with a blit/render.
     */
@@ -766,6 +766,18 @@ done:
    if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
       ctx->Driver.GenerateMipmap(ctx, target, texObj);
    }
+
+setup_fboinfo:
+   if (stImage->pt) {
+      texImage->IsDepthStencil =
+        screen->is_format_supported(screen, stImage->pt->format,
+                                    stImage->pt->target,
+                                    PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0);
+      texImage->IsColorRT =
+        screen->is_format_supported(screen, stImage->pt->format,
+                                    stImage->pt->target,
+                                    PIPE_TEXTURE_USAGE_RENDER_TARGET, 0);
+   }
 }
 
 
-- 
1.6.0.2


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to