mesa: Choose RGTC formats for GL_COMPRESSED_RED, GL_COMPRESSED_RG.

We were falling through to the default R8 and RG88 formats instead of
compressing when possible.  Noticed by swrast fbo-blending-formats
actually doing rendering.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Eric Anholt
2011-04-20 09:31:34 -07:00
parent da49de811d
commit bc880b8d40
+8
View File
@@ -621,7 +621,11 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
switch (internalFormat) {
case GL_R8:
case GL_RED:
RETURN_IF_SUPPORTED(MESA_FORMAT_R8);
break;
case GL_COMPRESSED_RED:
RETURN_IF_SUPPORTED(MESA_FORMAT_RED_RGTC1);
RETURN_IF_SUPPORTED(MESA_FORMAT_R8);
break;
@@ -631,7 +635,11 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_RG:
case GL_RG8:
RETURN_IF_SUPPORTED(MESA_FORMAT_RG88);
break;
case GL_COMPRESSED_RG:
RETURN_IF_SUPPORTED(MESA_FORMAT_RG_RGTC2);
RETURN_IF_SUPPORTED(MESA_FORMAT_RG88);
break;