[Mesa-dev] [PATCH] mesa: fix height error check for 1D array textures

2014-12-02 Thread Brian Paul
height=0 is legal for 1D array textures (as height=0 is legal for
2D arrays).  Fixes new piglit ext_texture_array-errors test.

Cc: "10.3 10.4" 
---
 src/mesa/main/teximage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 4f4bb11..7766904 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1542,7 +1542,7 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, 
GLenum target,
   maxSize >>= level;
   if (width < 2 * border || width > 2 * border + maxSize)
  return GL_FALSE;
-  if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
+  if (height < 0 || height > 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))
-- 
1.9.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: fix height error check for 1D array textures

2014-12-02 Thread Jose Fonseca

LGTM.

On 02/12/14 16:43, Brian Paul wrote:

height=0 is legal for 1D array textures (as height=0 is legal for


I think you mean "as depth=0 is legal for 2D arrays"


2D arrays).  Fixes new piglit ext_texture_array-errors test.

Cc: "10.3 10.4" 
---
  src/mesa/main/teximage.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 4f4bb11..7766904 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1542,7 +1542,7 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, 
GLenum target,
maxSize >>= level;
if (width < 2 * border || width > 2 * border + maxSize)
   return GL_FALSE;
-  if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
+  if (height < 0 || height > 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))



Jose
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: fix height error check for 1D array textures

2014-12-02 Thread Brian Paul

On 12/02/2014 09:49 AM, Jose Fonseca wrote:

LGTM.

On 02/12/14 16:43, Brian Paul wrote:

height=0 is legal for 1D array textures (as height=0 is legal for


I think you mean "as depth=0 is legal for 2D arrays"


Yes, thanks.

-Brian





2D arrays).  Fixes new piglit ext_texture_array-errors test.

Cc: "10.3 10.4" 
---
  src/mesa/main/teximage.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 4f4bb11..7766904 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1542,7 +1542,7 @@ _mesa_legal_texture_dimensions(struct gl_context
*ctx, GLenum target,
maxSize >>= level;
if (width < 2 * border || width > 2 * border + maxSize)
   return GL_FALSE;
-  if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
+  if (height < 0 || height > 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))



Jose


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev