mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 02:20:11 +01:00
mesa: don't call TexImage driver hooks for zero-sized images
This simply avoids some failed assertions but there's no reason to call the driver hooks for storing a tex image if its size is zero. Note: This is a candidate for the stable branches.
This commit is contained in:
parent
185d6df3c1
commit
91d8409649
1 changed files with 9 additions and 7 deletions
|
|
@ -2871,13 +2871,15 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
|
|||
border, internalFormat, texFormat);
|
||||
|
||||
/* Give the texture to the driver. <pixels> may be null. */
|
||||
if (compressed) {
|
||||
ctx->Driver.CompressedTexImage(ctx, dims, texImage,
|
||||
imageSize, pixels);
|
||||
}
|
||||
else {
|
||||
ctx->Driver.TexImage(ctx, dims, texImage, format,
|
||||
type, pixels, unpack);
|
||||
if (width > 0 && height > 0 && depth > 0) {
|
||||
if (compressed) {
|
||||
ctx->Driver.CompressedTexImage(ctx, dims, texImage,
|
||||
imageSize, pixels);
|
||||
}
|
||||
else {
|
||||
ctx->Driver.TexImage(ctx, dims, texImage, format,
|
||||
type, pixels, unpack);
|
||||
}
|
||||
}
|
||||
|
||||
check_gen_mipmap(ctx, target, texObj, level);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue