rgtc: fixup mipmap generation
authorDave Airlie <airlied@redhat.com>
Tue, 1 Mar 2011 23:48:40 +0000 (09:48 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Mar 2011 23:48:40 +0000 (09:48 +1000)
this allows swrast to pass mipmap generation for these formats.

src/mesa/main/mipmap.c

index d8a5610..0727e18 100644 (file)
@@ -1755,8 +1755,13 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
       if (srcImage->_BaseFormat == GL_RGB) {
          convertFormat = MESA_FORMAT_RGB888;
          components = 3;
-      }
-      else if (srcImage->_BaseFormat == GL_RGBA) {
+      } else if (srcImage->_BaseFormat == GL_RED) {
+         convertFormat = MESA_FORMAT_R8;
+         components = 1;
+      } else if (srcImage->_BaseFormat == GL_RG) {
+         convertFormat = MESA_FORMAT_RG88;
+         components = 2;
+      } else if (srcImage->_BaseFormat == GL_RGBA) {
          convertFormat = MESA_FORMAT_RGBA8888;
          components = 4;
       }