#include "main/format_utils.h"
#include "main/glformats.h"
#include "main/image.h"
-#include "util/imports.h"
+
#include "main/macros.h"
#include "main/mipmap.h"
#include "main/pack.h"
/* Try texture_subdata, which should be the fastest memcpy path. */
if (pixels &&
- !_mesa_is_bufferobj(unpack->BufferObj) &&
+ !unpack->BufferObj &&
_mesa_texstore_can_use_memcpy(ctx, texImage->_BaseFormat,
texImage->TexFormat, format, type,
unpack)) {
goto fallback;
}
- if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ if (unpack->BufferObj) {
if (try_pbo_upload(ctx, dims, texImage, format, type, dst_format,
xoffset, yoffset, zoffset,
width, height, depth, pixels, unpack))
goto fallback;
}
- if (!_mesa_is_bufferobj(ctx->Unpack.BufferObj))
+ if (!ctx->Unpack.BufferObj)
goto fallback;
if (st_compressed_format_fallback(st, texImage->TexFormat))
PIPE_TRANSFER_READ,
srcX, srcY,
width, height, &src_trans);
+ if (!map) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage()");
+ return;
+ }
if ((baseFormat == GL_DEPTH_COMPONENT ||
baseFormat == GL_DEPTH_STENCIL) &&
destX, destY, slice,
dst_width, dst_height, dst_depth,
&transfer);
+ if (!texDest) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage()");
+ goto err;
+ }
if (baseFormat == GL_DEPTH_COMPONENT ||
baseFormat == GL_DEPTH_STENCIL) {
GLfloat *tempSrc =
malloc(width * height * 4 * sizeof(GLfloat));
- if (tempSrc && texDest) {
+ if (tempSrc) {
const GLint dims = 2;
GLint dstRowStride;
struct gl_texture_image *texImage = &stImage->base;
}
st_texture_image_unmap(st, stImage, slice);
+err:
pipe->transfer_unmap(pipe, src_trans);
}
}
else {
/* assume a full set of mipmaps */
- pt.last_level = _mesa_logbase2(MAX3(width, height, depth));
+ pt.last_level = util_logbase2(MAX3(width, height, depth));
}
return pipe->screen->can_create_resource(pipe->screen, &pt);