From 529e0a98d477e33f41f680926f8b9c745aebbe90 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 23 Sep 2004 17:34:52 +0000 Subject: [PATCH] don't test for NULL pixels pointer here, do that in the 'store' routines after validating PBO address --- src/mesa/main/teximage.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b60a91f3703..8f27af970c4 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1979,6 +1979,9 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } + /* + * XXX Move this code into a new driver fall-back function + */ { const GLint width = texImage->Width; const GLint height = texImage->Height; @@ -2396,7 +2399,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level, texImage = _mesa_select_tex_image(ctx, texUnit, target, level); assert(texImage); - if (width == 0 || !pixels) + if (width == 0) return; /* no-op, not an error */ /* If we have a border, xoffset=-1 is legal. Bias by border width */ @@ -2443,7 +2446,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level, texImage = _mesa_select_tex_image(ctx, texUnit, target, level); assert(texImage); - if (width == 0 || height == 0 || !pixels) + if (width == 0 || height == 0) return; /* no-op, not an error */ /* If we have a border, xoffset=-1 is legal. Bias by border width */ @@ -2485,7 +2488,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level, texImage = _mesa_select_tex_image(ctx, texUnit, target, level); assert(texImage); - if (width == 0 || height == 0 || height == 0 || !pixels) + if (width == 0 || height == 0 || height == 0) return; /* no-op, not an error */ /* If we have a border, xoffset=-1 is legal. Bias by border width */ @@ -3195,7 +3198,7 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, return; } - if (width == 0 || !data) + if (width == 0) return; /* no-op, not an error */ if (ctx->Driver.CompressedTexSubImage1D) { @@ -3246,7 +3249,7 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, return; } - if (width == 0 || height == 0 || !data) + if (width == 0 || height == 0) return; /* no-op, not an error */ if (ctx->Driver.CompressedTexSubImage2D) { @@ -3297,7 +3300,7 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, return; } - if (width == 0 || height == 0 || depth == 0 || !data) + if (width == 0 || height == 0 || depth == 0) return; /* no-op, not an error */ if (ctx->Driver.CompressedTexSubImage3D) { -- 2.30.2