mesa: fix up assertion in _mesa_source_buffer_exists
authorMarek Olšák <maraeo@gmail.com>
Mon, 14 Mar 2011 09:20:55 +0000 (10:20 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 14 Mar 2011 09:24:24 +0000 (10:24 +0100)
This was probably missed when implementing luminance and luminance alpha
render targets.

_mesa_get_format_bits checks for both GL_*_BITS and GL_TEXTURE_*_SIZE.

This fixes:
main/framebuffer.c:892: _mesa_source_buffer_exists: Assertion `....' failed.

src/mesa/main/framebuffer.c

index 8916441f4554b68fdbc820a1cfaa989a7308754a..430e013d017b10b6702739e30064a5a36145810b 100644 (file)
@@ -889,6 +889,8 @@ _mesa_source_buffer_exists(struct gl_context *ctx, GLenum format)
       }
       ASSERT(_mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_RED_BITS) > 0 ||
              _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_ALPHA_BITS) > 0 ||
+             _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_TEXTURE_LUMINANCE_SIZE) > 0 ||
+             _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_TEXTURE_INTENSITY_SIZE) > 0 ||
              _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_INDEX_BITS) > 0);
       break;
    case GL_DEPTH: