mesa: choose texture format in _mesa_get_fallback_texture()
authorBrian Paul <brianp@vmware.com>
Thu, 29 Oct 2009 01:33:48 +0000 (19:33 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 29 Oct 2009 01:33:48 +0000 (19:33 -0600)
src/mesa/main/texobj.c

index 678845ece068ff0fd694c7ed6f52d555b8b58cd8..f69379da46d0c44f90065d6fefbb5304fc4ef263 100644 (file)
@@ -33,6 +33,7 @@
 #include "context.h"
 #include "enums.h"
 #include "fbobject.h"
+#include "formats.h"
 #include "hash.h"
 #include "imports.h"
 #include "macros.h"
@@ -740,6 +741,10 @@ _mesa_get_fallback_texture(GLcontext *ctx)
       _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage,
                                     8, 8, 1, 0, GL_RGBA); 
 
+      texImage->TexFormat =
+         ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE);
+      ASSERT(texImage->TexFormat != MESA_FORMAT_NONE);
+
       /* set image data */
       ctx->Driver.TexImage2D(ctx, GL_TEXTURE_2D, 0, GL_RGBA,
                              8, 8, 0,