From: Eric Anholt Date: Mon, 3 Jan 2011 02:11:34 +0000 (-0800) Subject: mesa: Also report renderbuffer red/green size for GL_RED and GL_RG. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f45aea0ec912159eb6aa4ef2ba2bdcd022bc8aca;p=mesa.git mesa: Also report renderbuffer red/green size for GL_RED and GL_RG. Noticed by code inspection. --- 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)