[MESA]
[reactos.git] / reactos / dll / opengl / mesa / main / readpix.c
index a3ff1a8..819b22d 100644 (file)
@@ -34,7 +34,6 @@
 #include "image.h"
 #include "mtypes.h"
 #include "pack.h"
-#include "pbo.h"
 #include "state.h"
 
 
@@ -401,8 +400,6 @@ _mesa_readpixels(struct gl_context *ctx,
    /* Do all needed clipping here, so that we can forget about it later */
    if (_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
 
-      pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels);
-
       if (pixels) {
          switch (format) {
          case GL_STENCIL_INDEX:
@@ -418,8 +415,6 @@ _mesa_readpixels(struct gl_context *ctx,
             read_rgba_pixels(ctx, x, y, width, height, format, type, pixels,
                              &clippedPacking);
          }
-
-         _mesa_unmap_pbo_dest(ctx, &clippedPacking);
       }
    }
 }
@@ -536,9 +531,8 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
 
 
 void GLAPIENTRY
-_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
-                     GLenum format, GLenum type, GLsizei bufSize,
-                      GLvoid *pixels )
+_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
+    GLenum format, GLenum type, GLvoid *pixels )
 {
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -588,33 +582,6 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
    if (width == 0 || height == 0)
       return; /* nothing to do */
 
-   if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1,
-                                  format, type, bufSize, pixels)) {
-      if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glReadPixels(out of bounds PBO access)");
-      } else {
-         _mesa_error(ctx, GL_INVALID_OPERATION,
-                     "glReadnPixelsARB(out of bounds access:"
-                     " bufSize (%d) is too small)", bufSize);
-      }
-      return;
-   }
-
-   if (_mesa_is_bufferobj(ctx->Pack.BufferObj) &&
-       _mesa_bufferobj_mapped(ctx->Pack.BufferObj)) {
-      /* buffer is mapped - that's an error */
-      _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)");
-      return;
-   }
-
    ctx->Driver.ReadPixels(ctx, x, y, width, height,
                          format, type, &ctx->Pack, pixels);
 }
-
-void GLAPIENTRY
-_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
-                 GLenum format, GLenum type, GLvoid *pixels )
-{
-   _mesa_ReadnPixelsARB(x, y, width, height, format, type, INT_MAX, pixels);
-}