Module: Mesa Branch: master Commit: 01ee5c63d3a8334f20e3fcaf6d19ba00bddf8268 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=01ee5c63d3a8334f20e3fcaf6d19ba00bddf8268
Author: Brian Paul <bri...@vmware.com> Date: Thu Oct 29 10:44:46 2009 -0600 mesa: move pixels==NULL check in glGetTexImage() --- src/mesa/main/texgetimage.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 2a6c358..0b439f2 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -111,17 +111,12 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, /* out of memory or other unexpected error */ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)"); return; - } /* <pixels> was an offset into the PBO. * Now make it a real, client-side pointer inside the mapped region. */ pixels = ADD_POINTERS(buf, pixels); } - else if (!pixels) { - /* not an error */ - return; - } { const GLint width = texImage->Width; @@ -318,10 +313,6 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, } img = ADD_POINTERS(buf, img); } - else if (!img) { - /* not an error */ - return; - } /* just memcpy, no pixelstore or pixel transfer */ _mesa_memcpy(img, texImage->Data, size); @@ -496,6 +487,11 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } + if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && !pixels) { + /* not an error, do nothing */ + return; + } + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); texImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -614,6 +610,11 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) return; } + if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && !img) { + /* not an error, do nothing */ + return; + } + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit