summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-11-23 15:33:45 -0700
committerBrian Paul <[email protected]>2011-11-28 08:07:09 -0700
commitf0b6e9a729d14740fc607c1148032d688f3c5c2c (patch)
treefdf5dc55d417dcdf0f83baf177948401ec732867 /src/mesa/main/fbobject.c
parent858d1f0b1cb9087f7eefcb3b8147e06457505ce0 (diff)
mesa: use _mesa_base_format_has_channel() in fbobject.c queries
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r--src/mesa/main/fbobject.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index f63a8e7bec3..2b4c70afbf7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -46,6 +46,7 @@
#include "state.h"
#include "teximage.h"
#include "texobj.h"
+#include "texparam.h"
/** Set this to 1 to help debug FBO incompleteness problems */
@@ -1477,48 +1478,10 @@ _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
static GLint
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)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
- if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA ||
- baseFormat == GL_LUMINANCE_ALPHA)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
- if (baseFormat == GL_DEPTH_COMPONENT || baseFormat == GL_DEPTH_STENCIL)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
- if (baseFormat == GL_STENCIL_INDEX || baseFormat == GL_DEPTH_STENCIL)
- return _mesa_get_format_bits(format, pname);
- else
- return 0;
- default:
+ if (_mesa_base_format_has_channel(baseFormat, pname))
+ return _mesa_get_format_bits(format, pname);
+ else
return 0;
- }
}