summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-09-28 11:17:27 -0700
committerIan Romanick <[email protected]>2010-10-01 15:49:12 -0700
commitcc6f13def53eb280b63427fbdeca197a09315062 (patch)
tree244516808fec4e3689d318401d9c1e6c92a0a123
parent3ebbc176f9200ac954d461758937e755220ac551 (diff)
ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support
-rw-r--r--src/mesa/main/texparam.c10
1 files changed, 10 insertions, 0 deletions
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);