mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.
authorEric Anholt <eric@anholt.net>
Wed, 11 Jan 2012 22:02:41 +0000 (14:02 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 12 Jan 2012 20:34:18 +0000 (12:34 -0800)
Fixes piglit EXT_framebuffer_multisample/negative-copyteximage.

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

src/mesa/main/teximage.c

index ce62248441dc9aa30a43f2068e355922a8c26d1c..39732522c55133f544bbe964d94cdbc8c67c521e 100644 (file)
@@ -1909,6 +1909,13 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
                      "glCopyTexImage%dD(invalid readbuffer)", dimensions);
          return GL_TRUE;
       }
+
+      if (ctx->ReadBuffer->Visual.samples > 0) {
+        _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
+                    "glCopyTexImage%dD(multisample FBO)",
+                    dimensions);
+        return GL_TRUE;
+      }
    }
 
    /* Check border */
@@ -2008,6 +2015,13 @@ copytexsubimage_error_check1( struct gl_context *ctx, GLuint dimensions,
                      "glCopyTexImage%dD(invalid readbuffer)", dimensions);
          return GL_TRUE;
       }
+
+      if (ctx->ReadBuffer->Visual.samples > 0) {
+        _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION,
+                    "glCopyTexSubImage%dD(multisample FBO)",
+                    dimensions);
+        return GL_TRUE;
+      }
    }
 
    /* check target (proxies not allowed) */