diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2009-11-19 19:57:26 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2009-11-19 19:58:27 -0800 |
commit | f7f97bd11d189c449cbdb5c07881e8b11f0fd4c1 (patch) | |
tree | eb554b658460fea482969a2f7c12846294bf8b26 | |
parent | c31c8583b563fa37bc2a097fb41fcfe8723ef294 (diff) |
ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support
-rw-r--r-- | src/mesa/main/texparam.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index ab170cde35..c93a979e1d 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -795,7 +795,22 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Border; break; case GL_TEXTURE_RED_SIZE: + if (img->_BaseFormat == GL_RED + || img->_BaseFormat == GL_RG + || img->_BaseFormat == GL_RGB + || img->_BaseFormat == GL_RGBA) + *params = _mesa_get_format_bits(texFormat, pname); + else + *params = 0; + break; case GL_TEXTURE_GREEN_SIZE: + if (img->_BaseFormat == GL_RG + || img->_BaseFormat == GL_RGB + || img->_BaseFormat == GL_RGBA) + *params = _mesa_get_format_bits(texFormat, pname); + else + *params = 0; + break; case GL_TEXTURE_BLUE_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) *params = _mesa_get_format_bits(texFormat, pname); |