mesa: remove redundant buffer checks in copytexture_error_check()
authorBrian Paul <brianp@vmware.com>
Thu, 13 Oct 2011 13:37:43 +0000 (07:37 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 13 Oct 2011 13:38:03 +0000 (07:38 -0600)
There was already a call to _mesa_source_buffer_exists() earlier in
the function.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/teximage.c

index 8efe715..28c9705 100644 (file)
@@ -1975,22 +1975,6 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
          return GL_TRUE;
       }
    }
-   else if (_mesa_is_depth_format(internalFormat)) {
-      /* make sure we have depth/stencil buffers */
-      if (!ctx->ReadBuffer->_DepthBuffer) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glCopyTexImage%dD(no depth)", dimensions);
-         return GL_TRUE;
-      }
-   }
-   else if (_mesa_is_depthstencil_format(internalFormat)) {
-      /* make sure we have depth/stencil buffers */
-      if (!ctx->ReadBuffer->_DepthBuffer || !ctx->ReadBuffer->_StencilBuffer) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glCopyTexImage%dD(no depth/stencil buffer)", dimensions);
-         return GL_TRUE;
-      }
-   }
 
    /* if we get here, the parameters are OK */
    return GL_FALSE;