From: Ian Romanick Date: Tue, 28 Sep 2010 18:17:27 +0000 (-0700) Subject: ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc6f13def53eb280b63427fbdeca197a09315062;p=mesa.git ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support --- diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 187049c0701..58d785812ea 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -870,7 +870,17 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Border; break; case GL_TEXTURE_RED_SIZE: + if (img->_BaseFormat == GL_RED) { + *params = _mesa_get_format_bits(texFormat, pname); + break; + } + /* FALLTHROUGH */ case GL_TEXTURE_GREEN_SIZE: + if (img->_BaseFormat == GL_RG) { + *params = _mesa_get_format_bits(texFormat, pname); + break; + } + /* FALLTHROUGH */ case GL_TEXTURE_BLUE_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) *params = _mesa_get_format_bits(texFormat, pname);