diff options
author | Eric Anholt <[email protected]> | 2011-01-02 17:58:07 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-01-03 13:28:24 -0800 |
commit | 059cca92a819e20e0d834605a3a7d277eaf88d9f (patch) | |
tree | e8ed2b8c91c91b80d5681ac834a8e5250bc2ff21 /src/mesa/main/framebuffer.c | |
parent | beac6ee62aea196d6e670abd4b198190e33e6cb1 (diff) |
mesa: Use the common logic for "is this baseformat a color format?"
When figuring out whether a renderbuffer should be used to set the
visual bits of an FBO, we were missing important baseformats like
GL_RED, GL_RG, and GL_LUMINANCE.
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r-- | src/mesa/main/framebuffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 5530c51c892..63da71c95b4 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -522,7 +522,8 @@ _mesa_update_draw_buffer_bounds(struct gl_context *ctx) * integer Z values. */ void -_mesa_update_framebuffer_visual(struct gl_framebuffer *fb) +_mesa_update_framebuffer_visual(struct gl_context *ctx, + struct gl_framebuffer *fb) { GLuint i; @@ -542,9 +543,8 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); const gl_format fmt = rb->Format; - - if (baseFormat == GL_RGBA || baseFormat == GL_RGB || - baseFormat == GL_ALPHA) { + + if (_mesa_is_legal_color_format(ctx, baseFormat)) { fb->Visual.redBits = _mesa_get_format_bits(fmt, GL_RED_BITS); fb->Visual.greenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS); fb->Visual.blueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS); |