summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Rogovin <[email protected]>2014-01-27 12:16:19 +0200
committerMatt Turner <[email protected]>2014-01-28 07:29:14 -0800
commit1db9ed6495b7ec80980d51e390891841bf28023a (patch)
tree9050cec2b1f75a3edad9042c02adddab22d7d5f6 /src
parent7b4592a489a4473bc886ceea11470231e7a98b0f (diff)
mesa: Allow depth = 0 parameter for TexImage3D.
Fixes the tests for the depth parameter for TexImage3D calls when the target type is GL_TEXTURE_2D_ARRAY or GL_TEXTURE_CUBE_MAP_ARRAY so that a depth value of 0 is accepted. Previously, the check incorrectly required the depth argument to be atleast 1. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/teximage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index a57c7da45ed..59a9870ed1b 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1568,7 +1568,7 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, GLenum target,
return GL_FALSE;
if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
- if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers)
+ if (depth < 0 || depth > ctx->Const.MaxArrayTextureLayers)
return GL_FALSE;
if (!ctx->Extensions.ARB_texture_non_power_of_two) {
if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
@@ -1585,7 +1585,7 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, GLenum target,
return GL_FALSE;
if (height < 2 * border || height > 2 * border + maxSize)
return GL_FALSE;
- if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers || depth % 6)
+ if (depth < 0 || depth > ctx->Const.MaxArrayTextureLayers || depth % 6)
return GL_FALSE;
if (width != height)
return GL_FALSE;