[Mesa-dev] [PATCH] mesa: GLES2 fix for OES float/half-float textures.

Erik Faye-Lund erik.faye-lund at collabora.com
Tue Dec 11 10:17:16 UTC 2018


On Mon, 2018-12-10 at 16:19 -0500, Nick Kreeger wrote:
> The OES_texture* extensions for float and half-float are valid when
> GLES2 is present w/ the matching
> OES_texture_float/OES_texture_half_float extensions. This fix ensures
> that these formats are valid for this configuration.

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>

> ---
>  src/mesa/main/glformats.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index 3a91600..785d720 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -2914,10 +2914,15 @@ _mesa_gles_error_check_format_and_type(const
> struct gl_context *ctx,
>        case GL_FLOAT:
>           switch (internalFormat) {
>           case GL_RGBA16F:
> +           if (!_mesa_has_OES_texture_half_float(ctx)) {
> +             return GL_INVALID_OPERATION;
> +           }
> +           break;
>           case GL_RGBA32F:
> -            if (ctx->Version <= 20)
> -               return GL_INVALID_OPERATION;
> -            break;
> +           if (!_mesa_has_OES_texture_float(ctx)) {
> +             return GL_INVALID_OPERATION;
> +           }
> +           break;
>           case GL_RGBA:
>              if (_mesa_has_OES_texture_float(ctx) && internalFormat
> == format)
>                 break;



More information about the mesa-dev mailing list