Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-01-28 Thread Jose Fonseca


- Original Message -
> width, height parameter of glTexImage2D() includes: texture image
> width + 2 * border (if any). So when doing the texture size check
> in _mesa_test_proxy_teximage() width and height should not exceed
> maximum supported size for target texture type.
> i.e. 1 << (ctx->Const.MaxTextureLevels - 1)
> 
> This patch fixes Intel oglconform test case: max_values
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970
> 
> Note: This is a candidate for mesa 8.0 branch.
> 
> Signed-off-by: Anuj Phogat 
> ---
>  src/mesa/main/teximage.c |   22 +++---
>  1 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index d11425d..018aca0 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context
> *ctx, GLenum target, GLint level,
> switch (target) {
> case GL_PROXY_TEXTURE_1D:
>maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
> -  if (width < 2 * border || width > 2 + maxSize)
> +  if (width < 2 * border || width > maxSize)

Anuj,

I may be missing something, but I'm still unsure about this, because this will 
create problems for drivers that do support borders.

Intel driver sets:

   ctx->Const.StripTextureBorder = GL_TRUE

So I'd expect the right expression to be

if (width < 2 * border || width > 2 * border + maxSize)

and that we do one two things:

- we return FALSE here if border > 0 and ctx->Const.StripTextureBorder == 
GL_TRUE

- or we make sure that the border is striped _everywhere_, including whatever 
upload path that caused the segfault in bug 44970.


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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-01-30 Thread Brian Paul
On Mon, Jan 30, 2012 at 12:52 PM, Anuj Phogat  wrote:
> width, height parameter of glTexImage2D() includes: texture image
> width + 2 * border (if any). So when doing the texture size check
> in _mesa_test_proxy_teximage() width and height should not exceed
> maximum supported size for target texture type + 2 * border.
> i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border
>
> Texture border is anyway stripped out before it is given to intel
> hardware driver.
>
> This patch fixes Intel oglconform test case: max_values
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970
>
> Note: This is a candidate for mesa 8.0 branch.
>
> Signed-off-by: Anuj Phogat 
> ---
>  Made the changes as per comments by Jose. This patch fixes the
>  segfault issue on intel h/w. I'll soon add a piglit testcase
>  which tests this patch.
>
>  src/mesa/main/teximage.c |   22 +++---
>  1 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index d11425d..1b45d66 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, 
> GLenum target, GLint level,
>    switch (target) {
>    case GL_PROXY_TEXTURE_1D:
>       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
> -      if (width < 2 * border || width > 2 + maxSize)
> +      if (width < 2 * border || width > 2 * border + maxSize)
>          return GL_FALSE;
>       if (level >= ctx->Const.MaxTextureLevels)
>          return GL_FALSE;
> @@ -1191,9 +1191,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, 
> GLenum target, GLint level,
>
>    case GL_PROXY_TEXTURE_2D:
>       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
> -      if (width < 2 * border || width > 2 + maxSize)
> +      if (width < 2 * border || width > 2 * border + maxSize)
>          return GL_FALSE;
> -      if (height < 2 * border || height > 2 + maxSize)
> +      if (height < 2 * border || height > 2 * border + maxSize)
>          return GL_FALSE;
>       if (level >= ctx->Const.MaxTextureLevels)
>          return GL_FALSE;
> @@ -1207,11 +1207,11 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, 
> GLenum target, GLint level,
>
>    case GL_PROXY_TEXTURE_3D:
>       maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
> -      if (width < 2 * border || width > 2 + maxSize)
> +      if (width < 2 * border || width > 2 * border + maxSize)
>          return GL_FALSE;
> -      if (height < 2 * border || height > 2 + maxSize)
> +      if (height < 2 * border || height > 2 * border + maxSize)
>          return GL_FALSE;
> -      if (depth < 2 * border || depth > 2 + maxSize)
> +      if (depth < 2 * border || depth > 2 * border + maxSize)
>          return GL_FALSE;
>       if (level >= ctx->Const.Max3DTextureLevels)
>          return GL_FALSE;
> @@ -1237,9 +1237,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, 
> GLenum target, GLint level,
>
>    case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
>       maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
> -      if (width < 2 * border || width > 2 + maxSize)
> +      if (width < 2 * border || width > 2 * border + maxSize)
>          return GL_FALSE;
> -      if (height < 2 * border || height > 2 + maxSize)
> +      if (height < 2 * border || height > 2 * border + maxSize)
>          return GL_FALSE;
>       if (level >= ctx->Const.MaxCubeTextureLevels)
>          return GL_FALSE;
> @@ -1253,7 +1253,7 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, 
> GLenum target, GLint level,
>
>    case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
>       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
> -      if (width < 2 * border || width > 2 + maxSize)
> +      if (width < 2 * border || width > 2 * border + maxSize)
>          return GL_FALSE;
>       if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
>          return GL_FALSE;
> @@ -1267,9 +1267,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, 
> GLenum target, GLint level,
>
>    case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
>       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
> -      if (width < 2 * border || width > 2 + maxSize)
> +      if (width < 2 * border || width > 2 * border + maxSize)
>          return GL_FALSE;
> -      if (height < 2 * border || height > 2 + maxSize)
> +      if (height < 2 * border || height > 2 * border + maxSize)
>          return GL_FALSE;
>       if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers)
>          return GL_FALSE;

Looks good to me.  You should probably wait for Jose to double-check though.

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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-01 Thread Ian Romanick

On 01/28/2012 04:04 AM, Jose Fonseca wrote:



- Original Message -

width, height parameter of glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type.
i.e. 1<<  (ctx->Const.MaxTextureLevels - 1)

This patch fixes Intel oglconform test case: max_values
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat
---
  src/mesa/main/teximage.c |   22 +++---
  1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index d11425d..018aca0 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context
*ctx, GLenum target, GLint level,
 switch (target) {
 case GL_PROXY_TEXTURE_1D:
maxSize = 1<<  (ctx->Const.MaxTextureLevels - 1);
-  if (width<  2 * border || width>  2 + maxSize)
+  if (width<  2 * border || width>  maxSize)


Anuj,

I may be missing something, but I'm still unsure about this, because this will 
create problems for drivers that do support borders.


AFAIK, the only desktop graphics hardware that ever supported borders is 
NVIDIA.  Their driver follows the convention (width + 2 * border) < 
maxSize, and their driver advertises a maximum size of 2^n.  I tried 
creating a proxy texture that was the full 2^n plus a border on their 
closed-source Linux driver, and it was rejected.  A proxy texture 2^n-2 
plus a border was accepted.


Based on that, I believe this patch is correct.


Intel driver sets:

ctx->Const.StripTextureBorder = GL_TRUE

So I'd expect the right expression to be

 if (width<  2 * border || width>  2 * border + maxSize)

and that we do one two things:

- we return FALSE here if border>  0 and ctx->Const.StripTextureBorder == 
GL_TRUE

- or we make sure that the border is striped _everywhere_, including whatever 
upload path that caused the segfault in bug 44970.


Jose

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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-01 Thread Jose Fonseca


- Original Message -
> On 01/28/2012 04:04 AM, Jose Fonseca wrote:
> >
> >
> > - Original Message -
> >> width, height parameter of glTexImage2D() includes: texture image
> >> width + 2 * border (if any). So when doing the texture size check
> >> in _mesa_test_proxy_teximage() width and height should not exceed
> >> maximum supported size for target texture type.
> >> i.e. 1<<  (ctx->Const.MaxTextureLevels - 1)
> >>
> >> This patch fixes Intel oglconform test case: max_values
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970
> >>
> >> Note: This is a candidate for mesa 8.0 branch.
> >>
> >> Signed-off-by: Anuj Phogat
> >> ---
> >>   src/mesa/main/teximage.c |   22 +++---
> >>   1 files changed, 11 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> >> index d11425d..018aca0 100644
> >> --- a/src/mesa/main/teximage.c
> >> +++ b/src/mesa/main/teximage.c
> >> @@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context
> >> *ctx, GLenum target, GLint level,
> >>  switch (target) {
> >>  case GL_PROXY_TEXTURE_1D:
> >> maxSize = 1<<  (ctx->Const.MaxTextureLevels - 1);
> >> -  if (width<  2 * border || width>  2 + maxSize)
> >> +  if (width<  2 * border || width>  maxSize)
> >
> > Anuj,
> >
> > I may be missing something, but I'm still unsure about this,
> > because this will create problems for drivers that do support
> > borders.
> 
> AFAIK, the only desktop graphics hardware that ever supported borders
> is
> NVIDIA.  Their driver follows the convention (width + 2 * border) <
> maxSize, and their driver advertises a maximum size of 2^n.  I tried
> creating a proxy texture that was the full 2^n plus a border on their
> closed-source Linux driver, and it was rejected.  A proxy texture
> 2^n-2
> plus a border was accepted.
> 
> Based on that, I believe this patch is correct.

Fair enough. Sounds good to me then!

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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-02 Thread Anuj Phogat
On Wed, Feb 1, 2012 at 12:52 PM, Jose Fonseca  wrote:

>
>
> - Original Message -
> > On 01/28/2012 04:04 AM, Jose Fonseca wrote:
> > >
> > >
> > > - Original Message -
> > >> width, height parameter of glTexImage2D() includes: texture image
> > >> width + 2 * border (if any). So when doing the texture size check
> > >> in _mesa_test_proxy_teximage() width and height should not exceed
> > >> maximum supported size for target texture type.
> > >> i.e. 1<<  (ctx->Const.MaxTextureLevels - 1)
> > >>
> > >> This patch fixes Intel oglconform test case: max_values
> > >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970
> > >>
> > >> Note: This is a candidate for mesa 8.0 branch.
> > >>
> > >> Signed-off-by: Anuj Phogat
> > >> ---
> > >>   src/mesa/main/teximage.c |   22 +++---
> > >>   1 files changed, 11 insertions(+), 11 deletions(-)
> > >>
> > >> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> > >> index d11425d..018aca0 100644
> > >> --- a/src/mesa/main/teximage.c
> > >> +++ b/src/mesa/main/teximage.c
> > >> @@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context
> > >> *ctx, GLenum target, GLint level,
> > >>  switch (target) {
> > >>  case GL_PROXY_TEXTURE_1D:
> > >> maxSize = 1<<  (ctx->Const.MaxTextureLevels - 1);
> > >> -  if (width<  2 * border || width>  2 + maxSize)
> > >> +  if (width<  2 * border || width>  maxSize)
> > >
> > > Anuj,
> > >
> > > I may be missing something, but I'm still unsure about this,
> > > because this will create problems for drivers that do support
> > > borders.
> >
> > AFAIK, the only desktop graphics hardware that ever supported borders
> > is
> > NVIDIA.  Their driver follows the convention (width + 2 * border) <
> > maxSize, and their driver advertises a maximum size of 2^n.  I tried
> > creating a proxy texture that was the full 2^n plus a border on their
> > closed-source Linux driver, and it was rejected.  A proxy texture
> > 2^n-2
> > plus a border was accepted.
> >
> > Based on that, I believe this patch is correct.
>
> Fair enough. Sounds good to me then!


This patch made the intel oglconform test to pass. But the errors reported in
oglconform failure stays unfixed. This is confirmed by a piglit test
case I developed to reproduce the errors. Test case
(validate-texture-size) is posted on piglit mailing list for review.

Driver throws assertion failure or segfaults with large textures even
much below the maximum supported size.

https://bugs.freedesktop.org/show_bug.cgi?id=44970
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-09 Thread Brian Paul

Anuj,

The patch you committed (15986d2), the first version you posted that 
tests:


  if (width < 2 * border || width > maxSize)
 return GL_FALSE;

causes my copy of conform (mustpass.c / proxy texture test) to fail 
with swrast/softpipe/llvmpipe.  It passes w/ NVIDIA's driver.


I thought you were going to commit the patch that does:

  if (width < 2 * border || width > 2 * border + maxSize)
 return GL_FALSE;

That allows conform to pass here.

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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-09 Thread Ian Romanick

On 02/09/2012 08:14 AM, Brian Paul wrote:

Anuj,

The patch you committed (15986d2), the first version you posted that tests:

if (width < 2 * border || width > maxSize)
return GL_FALSE;

causes my copy of conform (mustpass.c / proxy texture test) to fail with
swrast/softpipe/llvmpipe. It passes w/ NVIDIA's driver.

I thought you were going to commit the patch that does:

if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;

That allows conform to pass here.


Allow me to remove the egg from my face.  I dug a bit deeper into the 
test case that was previously failing and conform / mustpass.  What I 
said before 
(http://lists.freedesktop.org/archives/mesa-dev/2012-February/018562.html) 
was wrong.  You and Jose were correct.  Sorry.

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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-09 Thread Anuj Phogat
On Thu, Feb 9, 2012 at 11:02 AM, Ian Romanick  wrote:

> On 02/09/2012 08:14 AM, Brian Paul wrote:
>
>> Anuj,
>>
>> The patch you committed (15986d2), the first version you posted that
>> tests:
>>
>> if (width < 2 * border || width > maxSize)
>> return GL_FALSE;
>>
>> causes my copy of conform (mustpass.c / proxy texture test) to fail with
>> swrast/softpipe/llvmpipe. It passes w/ NVIDIA's driver.
>>
>> I thought you were going to commit the patch that does:
>>
>> if (width < 2 * border || width > 2 * border + maxSize)
>> return GL_FALSE;
>>
>> That allows conform to pass here.
>>
>
> Allow me to remove the egg from my face.  I dug a bit deeper into the test
> case that was previously failing and conform / mustpass.  What I said
> before (http://lists.freedesktop.org/**archives/mesa-dev/2012-**
> February/018562.html)
> was wrong.  You and Jose were correct.  Sorry.
>

Intel oglconform test case (max_values negative.textureSize.textureCube)
also passes with the patch i earlier posted as per Brian's
comments:http://lists.freedesktop.org/archives/mesa-dev/2012-January/018410.html<%20http://lists.freedesktop.org/archives/mesa-dev/2012-January/018410.html>
I'll make the required changes as per this patch.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-09 Thread Brian Paul

On 02/09/2012 12:15 PM, Anuj Phogat wrote:

On Thu, Feb 9, 2012 at 11:02 AM, Ian Romanick mailto:i...@freedesktop.org>> wrote:

On 02/09/2012 08:14 AM, Brian Paul wrote:

Anuj,

The patch you committed (15986d2), the first version you
posted that tests:

if (width < 2 * border || width > maxSize)
return GL_FALSE;

causes my copy of conform (mustpass.c / proxy texture test) to
fail with
swrast/softpipe/llvmpipe. It passes w/ NVIDIA's driver.

I thought you were going to commit the patch that does:

if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;

That allows conform to pass here.


Allow me to remove the egg from my face.  I dug a bit deeper into
the test case that was previously failing and conform / mustpass.
  What I said before

(http://lists.freedesktop.org/__archives/mesa-dev/2012-__February/018562.html
)
was wrong.  You and Jose were correct.  Sorry.


No biggie.



Intel oglconform test case (max_values
negative.textureSize.textureCube) also passes with the patch i earlier
posted as per Brian's comments:
http://lists.freedesktop.org/archives/mesa-dev/2012-January/018410.html 
<%20http://lists.freedesktop.org/archives/mesa-dev/2012-January/018410.html>
I'll make the required changes as per this patch.


Thanks, the test passes again.  But I have a follow-up comment for the 
patch in question...


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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-09 Thread Brian Paul

On 02/09/2012 01:57 PM, Brian Paul wrote:

On 02/09/2012 12:15 PM, Anuj Phogat wrote:

On Thu, Feb 9, 2012 at 11:02 AM, Ian Romanick mailto:i...@freedesktop.org>> wrote:

On 02/09/2012 08:14 AM, Brian Paul wrote:

Anuj,

The patch you committed (15986d2), the first version you
posted that tests:

if (width < 2 * border || width > maxSize)
return GL_FALSE;

causes my copy of conform (mustpass.c / proxy texture test) to
fail with
swrast/softpipe/llvmpipe. It passes w/ NVIDIA's driver.

I thought you were going to commit the patch that does:

if (width < 2 * border || width > 2 * border + maxSize)
return GL_FALSE;

That allows conform to pass here.


Allow me to remove the egg from my face. I dug a bit deeper into
the test case that was previously failing and conform / mustpass.
What I said before
(http://lists.freedesktop.org/__archives/mesa-dev/2012-__February/018562.html

)

was wrong. You and Jose were correct. Sorry.


No biggie.



Intel oglconform test case (max_values
negative.textureSize.textureCube) also passes with the patch i earlier
posted as per Brian's comments:
http://lists.freedesktop.org/archives/mesa-dev/2012-January/018410.html
<%20http://lists.freedesktop.org/archives/mesa-dev/2012-January/018410.html>

I'll make the required changes as per this patch.


Thanks, the test passes again. But I have a follow-up comment for the
patch in question...


Actually, this isn't directly related to your patch- the issue is with 
texture borders and array textures.


For a 1D texture array, the border only applies to the width.  For a 
2D texture array the border applies to the width and height but not 
the depth.  We're not handling this correctly everywhere.  For 
example, in _mesa_init_teximage_fields() we compute the 'Height2' 
field like this:


   if (height == 1) { /* 1-D texture */
  img->Height2 = 1;
  img->HeightLog2 = 0;
   }
   else {
  img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
  img->HeightLog2 = _mesa_logbase2(img->Height2);
   }

The else clause does the wrong thing if the texture is a 1D array 
texture with a border.  Similarly for Depth2 and 2D array textures.


Granted, borders are seldom used, but it would be good to go over all 
the teximage code and fix these mistakes.


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


Re: [Mesa-dev] [PATCH] mesa: fix maximum allowed proxy texture size condition

2012-02-09 Thread Anuj Phogat
On Thu, Feb 9, 2012 at 1:07 PM, Brian Paul  wrote:

> On 02/09/2012 01:57 PM, Brian Paul wrote:
>
>> On 02/09/2012 12:15 PM, Anuj Phogat wrote:
>>
>>> On Thu, Feb 9, 2012 at 11:02 AM, Ian Romanick >> > wrote:
>>>
>>> On 02/09/2012 08:14 AM, Brian Paul wrote:
>>>
>>> Anuj,
>>>
>>> The patch you committed (15986d2), the first version you
>>> posted that tests:
>>>
>>> if (width < 2 * border || width > maxSize)
>>> return GL_FALSE;
>>>
>>> causes my copy of conform (mustpass.c / proxy texture test) to
>>> fail with
>>> swrast/softpipe/llvmpipe. It passes w/ NVIDIA's driver.
>>>
>>> I thought you were going to commit the patch that does:
>>>
>>> if (width < 2 * border || width > 2 * border + maxSize)
>>> return GL_FALSE;
>>>
>>> That allows conform to pass here.
>>>
>>>
>>> Allow me to remove the egg from my face. I dug a bit deeper into
>>> the test case that was previously failing and conform / mustpass.
>>> What I said before
>>> (http://lists.freedesktop.org/**__archives/mesa-dev/2012-__**
>>> February/018562.html
>>>
>>> >> February/018562.html
>>> >)
>>>
>>> was wrong. You and Jose were correct. Sorry.
>>>
>>
>> No biggie.
>>
>>
>>  Intel oglconform test case (max_values
>>> negative.textureSize.**textureCube) also passes with the patch i earlier
>>> posted as per Brian's comments:
>>> http://lists.freedesktop.org/**archives/mesa-dev/2012-**
>>> January/018410.html
>>> <%20http://lists.freedesktop.**org/archives/mesa-dev/2012-**
>>> January/018410.html
>>> >
>>>
>>> I'll make the required changes as per this patch.
>>>
>>
>> Thanks, the test passes again. But I have a follow-up comment for the
>> patch in question...
>>
>
> Actually, this isn't directly related to your patch- the issue is with
> texture borders and array textures.
>
> For a 1D texture array, the border only applies to the width.  For a 2D
> texture array the border applies to the width and height but not the depth.
>  We're not handling this correctly everywhere.  For example, in
> _mesa_init_teximage_fields() we compute the 'Height2' field like this:
>
>   if (height == 1) { /* 1-D texture */
>  img->Height2 = 1;
>  img->HeightLog2 = 0;
>   }
>   else {
>  img->Height2 = height - 2 * border; /* == 1 << img->HeightLog2; */
>  img->HeightLog2 = _mesa_logbase2(img->Height2);
>   }
>
> The else clause does the wrong thing if the texture is a 1D array texture
> with a border.  Similarly for Depth2 and 2D array textures.
>
> Granted, borders are seldom used, but it would be good to go over all the
> teximage code and fix these mistakes.
>

yes, i agree. I'll send out a separate patch to fix such cases in  teximage
code.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev