mesa: raise GL_INVALID_OPERATION for glReadPixels(GL_COLOR_INDEX)
authorBrian Paul <brianp@vmware.com>
Tue, 20 Apr 2010 22:12:34 +0000 (16:12 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 20 Apr 2010 22:17:08 +0000 (16:17 -0600)
We no longer support CI-mode color buffers so this is always an error.

src/mesa/main/readpix.c

index f4d74e8be6d7a570c305f2a4c1d224ec4ece7212..93f2bd31cc60b688eabcccac8244300d21d50573 100644 (file)
@@ -103,6 +103,12 @@ _mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type,
                         "glReadPixels(no color buffer)");
             return GL_TRUE;
          }
+         /* We no longer support CI-mode color buffers so trying to read
+          * GL_COLOR_INDEX pixels is always an error.
+          */
+         _mesa_error(ctx, GL_INVALID_OPERATION,
+                     "glReadPixels(color buffer is RGB)");
+         return GL_TRUE;
       }
       break;
    case GL_STENCIL_INDEX: