diff options
author | marha <marha@users.sourceforge.net> | 2011-07-26 08:58:05 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-26 08:58:05 +0200 |
commit | ece07bdeaa82ea59e74bcfc588bcabe5e47567c1 (patch) | |
tree | 661e19ae13980e19f6fe827be5322ca9e0f8e4d8 /mesalib/src/mesa/main/texparam.c | |
parent | 91e91b72f07f4e61db17ee86c6933a7217f0e25c (diff) | |
download | vcxsrv-ece07bdeaa82ea59e74bcfc588bcabe5e47567c1.tar.gz vcxsrv-ece07bdeaa82ea59e74bcfc588bcabe5e47567c1.tar.bz2 vcxsrv-ece07bdeaa82ea59e74bcfc588bcabe5e47567c1.zip |
libX11 libXext mesa pixman xserver xkeyboard-config git update 26 July 2011
Diffstat (limited to 'mesalib/src/mesa/main/texparam.c')
-rw-r--r-- | mesalib/src/mesa/main/texparam.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index 4b9dcb5d3..c4ec29533 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -915,9 +915,23 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = _mesa_compressed_format_to_glenum(ctx, texFormat); } else { - /* return the user's requested internal format */ - *params = img->InternalFormat; - } + /* If the true internal format is not compressed but the user + * requested a generic compressed format, we have to return the + * generic base format that matches. + * + * From page 119 (page 129 of the PDF) of the OpenGL 1.3 spec: + * + * "If no specific compressed format is available, + * internalformat is instead replaced by the corresponding base + * internal format." + * + * Otherwise just return the user's requested internal format + */ + const GLenum f = + _mesa_gl_compressed_format_base_format(img->InternalFormat); + + *params = (f != 0) ? f : img->InternalFormat; + } break; case GL_TEXTURE_BORDER: *params = img->Border; |