summaryrefslogtreecommitdiff
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2010-03-15 15:24:38 -0400
committerZack Rusin <zackr@vmware.com>2010-03-15 15:24:38 -0400
commit275c4bd3643d773210780cb8d578ca84f2604684 (patch)
tree8266edc39d4253ac0f2a0ecd41f560f3d815bb5c /src/mesa/main/readpix.c
parentc5c5cd7132e18f4aad8e73d8ee879f8823c4c1e7 (diff)
parentd0b35352ed27b1e66785c45ee95a352ed06b47ce (diff)
Merge remote branch 'origin/master' into gallium_draw_llvm
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index feea1d375f..f4d74e8be6 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -77,14 +77,7 @@ _mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type,
case GL_RGBA:
case GL_BGRA:
case GL_ABGR_EXT:
- if (drawing) {
- if (!ctx->DrawBuffer->Visual.rgbMode) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glDrawPixels(drawing RGB pixels into color index buffer)");
- return GL_TRUE;
- }
- }
- else {
+ if (!drawing) {
/* reading */
if (!_mesa_source_buffer_exists(ctx, GL_COLOR)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
@@ -95,10 +88,9 @@ _mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type,
break;
case GL_COLOR_INDEX:
if (drawing) {
- if (ctx->DrawBuffer->Visual.rgbMode &&
- (ctx->PixelMaps.ItoR.Size == 0 ||
- ctx->PixelMaps.ItoG.Size == 0 ||
- ctx->PixelMaps.ItoB.Size == 0)) {
+ if (ctx->PixelMaps.ItoR.Size == 0 ||
+ ctx->PixelMaps.ItoG.Size == 0 ||
+ ctx->PixelMaps.ItoB.Size == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glDrawPixels(drawing color index pixels into RGB buffer)");
return GL_TRUE;