Ensure we have a valid ReadBuffer for CopyTexSubImage, and
authorAlan Hourihane <alanh@fairlite.demon.co.uk>
Thu, 22 Mar 2007 14:26:49 +0000 (14:26 +0000)
committerAlan Hourihane <alanh@fairlite.demon.co.uk>
Thu, 22 Mar 2007 14:28:18 +0000 (14:28 +0000)
if not bail accordingly.

Previously we'd only do this test on compressed textures.

src/mesa/main/teximage.c

index 543d6efc984107d336858d2a174f1dbce45e24f8..706d3466955b0e6d20d8f2269656fb589acffe3b 100644 (file)
@@ -2061,12 +2061,6 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions,
    }
 
    if (teximage->IsCompressed) {
-      if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glCopyTexSubImage%dD(missing readbuffer)", dimensions);
-         return GL_TRUE;
-      }
-
       if (target != GL_TEXTURE_2D) {
          _mesa_error(ctx, GL_INVALID_ENUM,
                      "glCopyTexSubImage%d(target)", dimensions);
@@ -2096,6 +2090,12 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions,
       return GL_TRUE;
    }
 
+   if (!_mesa_source_buffer_exists(ctx, teximage->_BaseFormat)) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+               "glCopyTexSubImage%dD(missing readbuffer)", dimensions);
+      return GL_TRUE;
+   }
+
    if (teximage->_BaseFormat == GL_DEPTH_COMPONENT) {
       if (!ctx->ReadBuffer->_DepthBuffer) {
          _mesa_error(ctx, GL_INVALID_OPERATION,