From f45aea0ec912159eb6aa4ef2ba2bdcd022bc8aca Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 2 Jan 2011 18:11:34 -0800 Subject: [PATCH] mesa: Also report renderbuffer red/green size for GL_RED and GL_RG. Noticed by code inspection. --- src/mesa/main/fbobject.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- 2.30.2