mesa: Throw the required error for glCopyPixels from multisample FBO.
authorEric Anholt <eric@anholt.net>
Wed, 11 Jan 2012 22:06:17 +0000 (14:06 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 12 Jan 2012 20:34:20 +0000 (12:34 -0800)
Fixes piglit EXT_framebuffer_multisample/negative-copypixels.

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

src/mesa/main/drawpix.c

index 9f5b0b36eb7b1368573ed957c0100c007b090aa1..01983d945ca7a7f06321068cf10cf1e6616b5b87 100644 (file)
@@ -203,6 +203,12 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
       goto end;
    }
 
+   if (ctx->ReadBuffer->Name != 0 && ctx->ReadBuffer->Visual.samples > 0) {
+      _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
+                 "glCopyPixels(multisample FBO)");
+      goto end;
+   }
+
    if (!_mesa_source_buffer_exists(ctx, type) ||
        !_mesa_dest_buffer_exists(ctx, type)) {
       _mesa_error(ctx, GL_INVALID_OPERATION,