summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-01-11 13:54:53 -0800
committerEric Anholt <eric@anholt.net>2012-01-12 12:34:15 -0800
commit86b7c6707f915b07347070901d602917bc25dd0f (patch)
tree1f5d8dd678a646ba53492c4946ec4543d6cc03e2
parent0e8d156c3cd70a67c99a82e42e7875f69b6a5b94 (diff)
mesa: Throw the required error for glReadPixels() from a multisampled FBO.
Fixes piglit EXT_framebuffer_multisample-negative-readpixels. Reviewed-by: Brian Paul <brianp@vmware.com> NOTE: This is a candidate for the 8.0 branch.
-rw-r--r--src/mesa/main/readpix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 0c0e5394d66..c1489d21109 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -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;