On Sat, Jul 23, 2011 at 2:58 AM, Ian Romanick <i...@freedesktop.org> wrote: > From: Ian Romanick <ian.d.roman...@intel.com> > > --- > src/mesa/main/texcompress.c | 63 > +++++++++++++++++++++++++++++++++++++++++++ > src/mesa/main/texcompress.h | 3 ++ > 2 files changed, 66 insertions(+), 0 deletions(-) > > diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c > index d820ae9..4a8094f 100644 > --- a/src/mesa/main/texcompress.c > +++ b/src/mesa/main/texcompress.c > @@ -40,6 +40,69 @@ > > > /** > + * Get the GL base format of a specified GL compressed texture format > + * > + * \return > + * The base format of \c format if \c format is a compressed format (either > + * generic or specific. Otherwise 0 is returned. > + */ > +GLenum > +_mesa_gl_compressed_format_base_format(GLenum format) > +{ > + switch (format) { > + case GL_COMPRESSED_RGB: > + case GL_COMPRESSED_SRGB: > + case GL_COMPRESSED_RED: > + case GL_COMPRESSED_RG: > + case GL_COMPRESSED_RED_RGTC1: > + case GL_COMPRESSED_SIGNED_RED_RGTC1: > + case GL_COMPRESSED_RG_RGTC2: > + case GL_COMPRESSED_SIGNED_RG_RGTC2: > + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: > + case GL_COMPRESSED_RGB_FXT1_3DFX: > + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: > + return GL_RGB;
I think these cases need to be split up to return GL_RED and GL_RG base formats. The GL_ARB texture_rg extension defines those base formats so I'd assume that the glGetTexLevel query should return them too. Though, we should probably check what other vendors do. -Brian _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev