[Mesa-dev] [PATCH] intel: use _mesa_meta_Clear with OpenGL ES 1.1

Kenneth Graunke kenneth at whitecape.org
Wed Aug 8 09:33:09 PDT 2012


On 08/08/2012 01:34 AM, Tapani Pälli wrote:
> Patch changes i915 and i965 drivers to use fixed function version of
> meta clear when running on ES 1.1. This fixes rendering errors seen with
> Google Maps, Angry Birds and Gallery3D on Android platform.
> 
> Change 88128516d43be5d25288ff5b64db63cda83c04b3 exposes all extensions
> internally to be available independent of GL flavour, therefore check
> against ARB_fragment_shader does not work. Alternatively intel_extensions.c
> could be modified to enable/disable extension set based on version.
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/mesa/drivers/dri/i915/intel_clear.c | 6 +++---
>  src/mesa/drivers/dri/i965/brw_clear.c   | 7 ++++++-
>  2 files changed, 9 insertions(+), 4 deletions(-)

> diff --git a/src/mesa/drivers/dri/i915/intel_clear.c b/src/mesa/drivers/dri/i915/intel_clear.c
> index 96d9c8f..49ee2e9 100644
> --- a/src/mesa/drivers/dri/i915/intel_clear.c
> +++ b/src/mesa/drivers/dri/i915/intel_clear.c
> @@ -179,10 +179,10 @@ intelClear(struct gl_context *ctx, GLbitfield mask)
>  
>     if (tri_mask) {
>        debug_mask("tri", tri_mask);
> -      if (ctx->Extensions.ARB_fragment_shader)
> -	 _mesa_meta_glsl_Clear(&intel->ctx, tri_mask);
> -      else
> +      if (ctx->Version == 11)

I would prefer to see:
   if (ctx->API == API_OPENGLES)

>  	 _mesa_meta_Clear(&intel->ctx, tri_mask);
> +      else
> +	 _mesa_meta_glsl_Clear(&intel->ctx, tri_mask);
>     }
>  }
>  
> diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
> index 31c2e45..42670fe 100644
> --- a/src/mesa/drivers/dri/i965/brw_clear.c
> +++ b/src/mesa/drivers/dri/i965/brw_clear.c
> @@ -226,7 +226,12 @@ brw_clear(struct gl_context *ctx, GLbitfield mask)
>     if (tri_mask) {
>        debug_mask("tri", tri_mask);
>        mask &= ~tri_mask;
> -      _mesa_meta_glsl_Clear(&intel->ctx, tri_mask);
> +
> +      if(ctx->Version == 11) {

Ditto.

> +         _mesa_meta_Clear(&intel->ctx, tri_mask);
> +      } else {
> +         _mesa_meta_glsl_Clear(&intel->ctx, tri_mask);
> +      }
>     }
>  
>     /* Any strange buffers get passed off to swrast */
> 

I'm not sure that we want to go back to using _mesa_meta_Clear...we want
to be able to use GLSL internally, even on ES 1.x---we just can't expose
the API to the user.

I did some analysis about why glsl_Clear breaks on ES1 here:
https://bugs.freedesktop.org/show_bug.cgi?id=50333

That said, this is a small patch that gets things working in the
meantime, so with the Version => API changes, you can add:

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50333


More information about the mesa-dev mailing list