summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-10-02 09:51:12 -0600
committerBrian Paul <[email protected]>2012-10-04 07:59:11 -0600
commit91d84096497ff538f55591f7e6bb0b563726db8d (patch)
treef406edab37fd20586452a50529a38e76d089719a /src
parent185d6df3c10a7ff5defe163af614bfc41088910b (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/teximage.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 019516f00a4..2250815783f 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -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);