mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
mesa: don't allocate a texture if width or height is 0 in CopyTexImage
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4b69c1a92d)
This commit is contained in:
parent
5aacecb08c
commit
b3c8a250e6
1 changed files with 12 additions and 10 deletions
|
|
@ -3439,20 +3439,22 @@ copyteximage(struct gl_context *ctx, GLuint dims,
|
|||
_mesa_init_teximage_fields(ctx, texImage, width, height, 1,
|
||||
border, internalFormat, texFormat);
|
||||
|
||||
/* Allocate texture memory (no pixel data yet) */
|
||||
ctx->Driver.AllocTextureImageBuffer(ctx, texImage);
|
||||
if (width && height) {
|
||||
/* Allocate texture memory (no pixel data yet) */
|
||||
ctx->Driver.AllocTextureImageBuffer(ctx, texImage);
|
||||
|
||||
if (_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY,
|
||||
&width, &height)) {
|
||||
struct gl_renderbuffer *srcRb =
|
||||
get_copy_tex_image_source(ctx, texImage->TexFormat);
|
||||
if (_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY,
|
||||
&width, &height)) {
|
||||
struct gl_renderbuffer *srcRb =
|
||||
get_copy_tex_image_source(ctx, texImage->TexFormat);
|
||||
|
||||
ctx->Driver.CopyTexSubImage(ctx, dims, texImage, dstX, dstY, dstZ,
|
||||
srcRb, srcX, srcY, width, height);
|
||||
ctx->Driver.CopyTexSubImage(ctx, dims, texImage, dstX, dstY, dstZ,
|
||||
srcRb, srcX, srcY, width, height);
|
||||
}
|
||||
|
||||
check_gen_mipmap(ctx, target, texObj, level);
|
||||
}
|
||||
|
||||
check_gen_mipmap(ctx, target, texObj, level);
|
||||
|
||||
_mesa_update_fbo_texture(ctx, texObj, face, level);
|
||||
|
||||
_mesa_dirty_texobj(ctx, texObj, GL_TRUE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue