[Mesa-dev] [PATCH] mesa/gles: Allow format GL_RED to be used with MESA_FORMAT_R_UNORM

Kenneth Graunke kenneth at whitecape.org
Mon Apr 25 18:32:04 UTC 2016


On Monday, April 25, 2016 9:50:22 AM PDT Jordan Justen wrote:
> If the bound framebuffer has a format of MESA_FORMAT_R_UNORM, then
> IMPLEMENTATION_COLOR_READ_FORMAT will return GL_RED. This change
> applies to OpenGLES contexts where additional restrictions are placed
> on the formats that are allowed to be supported.
> 
> Fixes OpenGLES 3.1 CTS tests:
>  * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC16
>  * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC16Linear
>  * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC32F
>  * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC32FLinear
> 
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/main/framebuffer.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
> index f69dc6c..38bd680 100644
> --- a/src/mesa/main/framebuffer.c
> +++ b/src/mesa/main/framebuffer.c
> @@ -858,6 +858,8 @@ _mesa_get_color_read_format(struct gl_context *ctx)
>           return GL_BGRA;
>        else if (format == MESA_FORMAT_B5G6R5_UNORM)
>           return GL_BGR;
> +      else if (format == MESA_FORMAT_R_UNORM8)
> +         return GL_RED;
>  
>        switch (data_type) {
>        case GL_UNSIGNED_INT:
> 

I sort of wonder whether we need more formats, i.e. what about
R16_UNORM?  Then again, it might just be enabling an optional
feature.

At any rate, this fixes tests and doesn't stand in the way of
further improvements, so let's land it.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

Thanks for fixing this, Jordan!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160425/3237e368/attachment.sig>


More information about the mesa-dev mailing list