From dc3839ef3dc032627b7bb10b2c24786efc3ef5ec Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:27:59 -0600 Subject: mesa: move readbuffer tests --- src/mesa/main/colortab.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/colortab.c') diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index fcd54bc5cc..5447eb18ef 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -543,7 +543,10 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - /* Select buffer to read from */ + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width ); } @@ -556,6 +559,10 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width ); } -- cgit v1.2.3