diff options
author | Eric Anholt <eric@anholt.net> | 2011-01-02 18:11:34 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-01-03 13:28:26 -0800 |
commit | f45aea0ec912159eb6aa4ef2ba2bdcd022bc8aca (patch) | |
tree | d6ce794d4e9a27910be236e47951502ac4c2e18a /src/mesa/main | |
parent | 059cca92a819e20e0d834605a3a7d277eaf88d9f (diff) |
mesa: Also report renderbuffer red/green size for GL_RED and GL_RG.
Noticed by code inspection.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fbobject.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 5a93b0f03af..f7b77233500 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1171,8 +1171,17 @@ get_component_bits(GLenum pname, GLenum baseFormat, gl_format format) switch (pname) { case GL_RENDERBUFFER_RED_SIZE_EXT: case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA || + baseFormat == GL_RG || baseFormat == GL_RED) + return _mesa_get_format_bits(format, pname); + else + return 0; case GL_RENDERBUFFER_GREEN_SIZE_EXT: case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA || baseFormat == GL_RG) + return _mesa_get_format_bits(format, pname); + else + return 0; case GL_RENDERBUFFER_BLUE_SIZE_EXT: case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: if (baseFormat == GL_RGB || baseFormat == GL_RGBA) |