The intel driver (and gallium, it looks like, though it doesn't use
these texstore functions at this point) doesn't bother making storage
for textures with 0 width, height, or depth. This avoids them having
to deal with returning a mapping for that nonexistent data.
Fixes assertion failures with an upcoming intel driver change.
Reviewed-by: Brian Paul <brianp@vmware.com>
(void) border;
+ if (width == 0)
+ return;
+
/* allocate storage for texture data */
if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat,
width, 1, 1)) {
(void) border;
+ if (width == 0 || height == 0)
+ return;
+
/* allocate storage for texture data */
if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat,
width, height, 1)) {
(void) border;
+ if (width == 0 || height == 0 || depth == 0)
+ return;
+
/* allocate storage for texture data */
if (!ctx->Driver.AllocTextureImageBuffer(ctx, texImage, texImage->TexFormat,
width, height, depth)) {