ARB_texture_rg: Add GL_TEXTURE_{RED,GREEN}_SIZE query support
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 28 Sep 2010 18:17:27 +0000 (11:17 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 1 Oct 2010 22:49:12 +0000 (15:49 -0700)
src/mesa/main/texparam.c

index 187049c07013efe67177fb63594233103444c506..58d785812eac2c3bf4607ecf46cb0eeaabcec194 100644 (file)
@@ -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);