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

Author: Michel Dänzer <daen...@vmware.com>
Date:   Sat Oct  3 18:01:57 2009 +0200

meta: Make sure texImage->TexFormat is valid for CopyTex(Sub)Image.

---

 src/mesa/drivers/common/meta.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 12e0bdd..e173224 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -55,6 +55,7 @@
 #include "main/stencil.h"
 #include "main/texobj.h"
 #include "main/texenv.h"
+#include "main/texformat.h"
 #include "main/teximage.h"
 #include "main/texparam.h"
 #include "main/texstate.h"
@@ -2471,6 +2472,12 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum 
target, GLint level,
       return;
    }
 
+   if (texImage->TexFormat == &_mesa_null_texformat)
+       texImage->TexFormat = ctx->Driver.ChooseTextureFormat(ctx,
+                                                             internalFormat,
+                                                             format,
+                                                             type);
+
    _mesa_unlock_texture(ctx, texObj); /* need to unlock first */
 
    /*

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to