[Mesa-dev] [PATCH] meta: Don't _mesa_set_enable() invalid targets in ES 1.

Ian Romanick idr at freedesktop.org
Fri Sep 14 23:23:40 PDT 2012


On 09/14/2012 01:01 PM, Kenneth Graunke wrote:
> GL_TEXTURE_1D, GL_TEXTURE_RECTANGLE, and GL_TEXTURE_GEN_* don't exist in
> ES 1 contexts, so any meta ops that used _mesa_meta_begin with
> MESA_META_TEXTURE would trigger GL errors.  One such operation is
> _mesa_meta_Clear().
>
> Fixes the ES1 conformance test miplin.c, which was regressed by commit
> 08be1d288f216232d3974f5997b266a8dd720928.

There is, however, GL_TEXTURE_GEN_STR_OES.  In ES1 we should twiddle 
that instead.  It's part of GL_OES_texture_cube_map, which I don't think 
is supported by all ES1 drivers.

It almost seems like we want separate _mesa_meta_begin functions for 
each API.  It's getting quite divergent. :(

> NOTE: This is a candidate for the 9.0 branch.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
> Cc: Ian Romanick <idr at freedesktop.org>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>   src/mesa/drivers/common/meta.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index 36672a7..f6cf31d 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -648,19 +648,22 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
>               if (ctx->Texture.Unit[u].Enabled ||
>                   ctx->Texture.Unit[u].TexGenEnabled) {
>                  _mesa_ActiveTextureARB(GL_TEXTURE0 + u);
> -               _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE);
>                  _mesa_set_enable(ctx, GL_TEXTURE_2D, GL_FALSE);
>                  _mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE);
>                  if (ctx->Extensions.ARB_texture_cube_map)
>                     _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE);
> -               if (ctx->Extensions.NV_texture_rectangle)
> -                  _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE);
>                  if (ctx->Extensions.OES_EGL_image_external)
>                     _mesa_set_enable(ctx, GL_TEXTURE_EXTERNAL_OES, GL_FALSE);
> -               _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, GL_FALSE);
> -               _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, GL_FALSE);
> -               _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, GL_FALSE);
> -               _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, GL_FALSE);
> +
> +               if (ctx->API == API_OPENGL) {
> +                  _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE);
> +                  if (ctx->Extensions.NV_texture_rectangle)
> +                     _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE);
> +                  _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, GL_FALSE);
> +                  _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, GL_FALSE);
> +                  _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, GL_FALSE);
> +                  _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, GL_FALSE);
> +               }
>               }
>            }
>         }
>



More information about the mesa-dev mailing list