mesa: Throw the required error for glReadPixels() from a multisampled FBO.
authorEric Anholt <eric@anholt.net>
Wed, 11 Jan 2012 21:54:53 +0000 (13:54 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 12 Jan 2012 20:34:15 +0000 (12:34 -0800)
Fixes piglit EXT_framebuffer_multisample-negative-readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.

src/mesa/main/readpix.c

index 0c0e5394d66b5aba6d9c216d17a6fd389856c428..c1489d211095f89b98b02d19e03345108166dd90 100644 (file)
@@ -782,6 +782,11 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
       return;
    }
 
+   if (ctx->ReadBuffer->Name != 0 && ctx->ReadBuffer->Visual.samples > 0) {
+      _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(multisample FBO)");
+      return;
+   }
+
    if (!_mesa_source_buffer_exists(ctx, format)) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)");
       return;