diff options
author | Brian Paul <[email protected]> | 2009-10-29 10:44:46 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-10-29 10:50:26 -0600 |
commit | 01ee5c63d3a8334f20e3fcaf6d19ba00bddf8268 (patch) | |
tree | 1c316c60cacc0e02188b1ac332fc019660927770 /src/mesa/main | |
parent | 99bbf4b4f55b3b0038cbaadefb92ea4a73af6e0a (diff) |
mesa: move pixels==NULL check in glGetTexImage()
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | 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 2a6c358e414..0b439f2e2ef 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); |