[Mesa-dev] [PATCH] arb_texture_cube_map_array: fix attrib push/pop

Brian Paul brianp at vmware.com
Wed Nov 7 07:00:18 PST 2012


On 11/06/2012 07:56 PM, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> fdo9833 piglit test caught this.

What exactly was the failure?

BTW, that test should really be rewritten as non-bug test.  I think 
I'll do that.


>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
>   src/mesa/main/attrib.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> index 05db35b..92d6a97 100644
> --- a/src/mesa/main/attrib.c
> +++ b/src/mesa/main/attrib.c
> @@ -684,7 +684,10 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
>            _mesa_set_enable(ctx, GL_TEXTURE_2D_ARRAY_EXT,
>                             !!(unit->Enabled&  TEXTURE_2D_ARRAY_BIT));
>         }
> -
> +      if (ctx->Extensions.ARB_texture_cube_map_array) {
> +         _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP_ARRAY,
> +                          !!(unit->Enabled&  TEXTURE_CUBE_ARRAY_BIT));
> +      }

I don't think we need this.  AFAIK, cube map arrays can only be used 
with shaders, not fixed-function.  The GL_TEXTURE_x tokens for 
glEnable/Disable() are only relevant for fixed-function.

I don't see any changes to enable.c in your patch series so there's no 
code for enabling/disabling GL_TEXTURE_CUBE_MAP_ARRAY. So wouldn't 
this raise GL_INVALID_ENUM?


>         _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
>         _mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor);
>         _mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode);
> @@ -762,7 +765,10 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
>                     !ctx->Extensions.MESA_texture_array) {
>               continue;
>            }
> -         else if (obj->Target == GL_TEXTURE_BUFFER)
> +         else if (obj->Target == GL_TEXTURE_CUBE_MAP_ARRAY&&
> +             !ctx->Extensions.ARB_texture_cube_map_array) {
> +            continue;
> +         } else if (obj->Target == GL_TEXTURE_BUFFER)
>               continue;
>            else if (obj->Target == GL_TEXTURE_EXTERNAL_OES)
>               continue;

That part looks good.

-Brian


More information about the mesa-dev mailing list