mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 02:20:11 +01:00
mesa: move pixels==NULL check in glGetTexImage()
This commit is contained in:
parent
99bbf4b4f5
commit
01ee5c63d3
1 changed files with 10 additions and 9 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue