[Mesa-dev] [PATCH 1/8] mesa: handle OES_texture_half_float formats in _mesa_base_tex_format()

Wladimir J. van der Laan laanwj at gmail.com
Sat Oct 21 06:49:36 UTC 2017


On Fri, Oct 20, 2017 at 10:21:21PM +0200, Christian Gmeiner wrote:
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  src/mesa/main/glformats.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Reviewed-by: Wladimir J. van der Laan <laanwj at gmail.com>

(as far as I'm qualified to review this code)

> 
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index 1e797c24c2..78299aebae 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -2424,6 +2424,25 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat)
>           return GL_YCBCR_MESA;
>     }
>  
> +   if (ctx->Extensions.OES_texture_half_float) {
> +       switch (internalFormat) {
> +       case GL_ALPHA16F_ARB:
> +          return GL_ALPHA;
> +       case GL_RGBA16F_ARB:
> +          return GL_RGBA;
> +       case GL_RGB16F_ARB:
> +          return GL_RGB;
> +       case GL_INTENSITY16F_ARB:
> +          return GL_INTENSITY;
> +       case GL_LUMINANCE16F_ARB:
> +          return GL_LUMINANCE;
> +       case GL_LUMINANCE_ALPHA16F_ARB:
> +          return GL_LUMINANCE_ALPHA;
> +       default:
> +          ; /* fallthrough */

Looks good to me.

These tokens match the _EXT float formats defined in the OpenGL ES gl2ext.h
(except for GL_INTENSITY16F_ARB which has no ES equivalent), that's great, as
there's no _ARB formats there.

The R and RG textures are handled in ctx->Extensions.ARB_texture_rg so indeed
doesn't have to be done here.

> +       }
> +   }
> +
>     if (ctx->Extensions.ARB_texture_float) {
>        switch (internalFormat) {
>        case GL_ALPHA16F_ARB:
> -- 
> 2.11.0
> 
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv


More information about the mesa-dev mailing list