msaa: Generate proper error for operations prohibited on MSAA buffers.
authorPaul Berry <stereotype441@gmail.com>
Mon, 16 Jul 2012 18:25:50 +0000 (11:25 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 17 Jul 2012 21:40:01 +0000 (14:40 -0700)
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@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/drawpix.c
src/mesa/main/teximage.c

index def55dddde1f1cca88d433bcc46185f4126ddf4f..fdcbcccded294d41558336cdf3c25a93b92429a8 100644 (file)
@@ -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;
    }
index 126386ebed612b1ff5d3f5fa3dc9a9dacf7a92f3..64b25a82decf7df82762d1e3556912c58bd9d45f 100644 (file)
@@ -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;