Mesa (master): msaa: Generate proper error for operations prohibited on MSAA buffers.

Paul Berry stereotype441 at kemper.freedesktop.org
Tue Jul 17 21:42:22 UTC 2012


Module: Mesa
Branch: master
Commit: e9b908b014be57cd2d3f0432adf16ac5b9631325
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9b908b014be57cd2d3f0432adf16ac5b9631325

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Mon Jul 16 11:25:50 2012 -0700

msaa: Generate proper error for operations prohibited on MSAA buffers.

>From the GL 3.0 spec, section 4.3.3, in the documentation for
CopyPixels():

    "An INVALID_OPERATION error will be generated if the object bound
    to READ_FRAMEBUFFER_BINDING is framebuffer complete and the value
    of SAMPLE_BUFFERS is greater than zero."

The same applies to CopyTexImage...() and CopyTexSubImage...()
functions, since they are defined in terms of CopyPixels().

Previously we were generating an INVALID_FRAMEBUFFER_OPERATION error
in these cases.

Fixes piglit tests
"EXT_framebuffer_multisample/negative-{copypixels,copyteximage}".

Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/drawpix.c  |    2 +-
 src/mesa/main/teximage.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index def55dd..fdcbccc 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -240,7 +240,7 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
    }
 
    if (ctx->ReadBuffer->Name != 0 && ctx->ReadBuffer->Visual.samples > 0) {
-      _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
+      _mesa_error(ctx, GL_INVALID_OPERATION,
 		  "glCopyPixels(multisample FBO)");
       goto end;
    }
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 126386e..64b25a8 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2005,7 +2005,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
       }
 
       if (ctx->ReadBuffer->Visual.samples > 0) {
-	 _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
+	 _mesa_error(ctx, GL_INVALID_OPERATION,
 		     "glCopyTexImage%dD(multisample FBO)",
 		     dimensions);
 	 return GL_TRUE;
@@ -2130,7 +2130,7 @@ copytexsubimage_error_check1( struct gl_context *ctx, GLuint dimensions,
       }
 
       if (ctx->ReadBuffer->Visual.samples > 0) {
-	 _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
+	 _mesa_error(ctx, GL_INVALID_OPERATION,
 		     "glCopyTexSubImage%dD(multisample FBO)",
 		     dimensions);
 	 return GL_TRUE;




More information about the mesa-commit mailing list