[Mesa-dev] [PATCH] mesa: Add GL_RED and GL_RG to ES3 effective internal format mapping.

Alejandro Piñeiro apinheiro at igalia.com
Sat Mar 5 08:16:28 UTC 2016


On 05/03/16 07:49, Kenneth Graunke wrote:
> The dEQP-GLES3.functional.fbo.completeness.renderable.texture.
> {color0,depth,stencil}.{red,rg}_unsigned_byte tests appear to expect
> GL_RED/GL_RG and GL_UNSIGNED_BYTE to map to GL_R8/GL_RG8, rather than
> returning an INVALID_OPERATION error.
>
> This makes perfect sense.  However, RED and RG are strangely missing
> from the ES 3.0/3.1/3.2 spec's "Effective internal format corresponding
> to external format and type" tables.  It may be worth filing a spec bug.

FWIW, the mapping is is included at the "Valid combinations of format,
type and sized internalformat" (Section 3.7.2 table 3.2 at ES 3.0 spec,
Section 8.4.2 table 8.2 at ES 3.1 spec). As that mesa method returns
"only return a valid effective internal format if the combination of
format, type and internal format in base form, is acceptable." I think
that makes sense reading from those tables too.

>
> Fixes the 6 dEQP tests mentioned above.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/main/glformats.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index edfd7d6..cf64958 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -2603,6 +2603,10 @@ _mesa_es3_effective_internal_format_for_format_and_type(GLenum format,
>           return GL_RGBA8;
>        case GL_RGB:
>           return GL_RGB8;
> +      case GL_RG:
> +         return GL_RG8;
> +      case GL_RED:
> +         return GL_R8;
>        /* Although LUMINANCE_ALPHA, LUMINANCE and ALPHA appear in table 3.12,
>         * (section 3.8 Texturing, page 128 of the OpenGL-ES 3.0.4) as effective
>         * internal formats, they do not correspond to GL constants, so the base

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>




More information about the mesa-dev mailing list