Mesa (master): rgtc: fixup mipmap generation

Dave Airlie airlied at kemper.freedesktop.org
Tue Mar 1 23:44:11 UTC 2011


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar  2 09:48:40 2011 +1000

rgtc: fixup mipmap generation

this allows swrast to pass mipmap generation for these formats.

---

 src/mesa/main/mipmap.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index d8a5610..0727e18 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -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;
       }




More information about the mesa-commit mailing list