From: Jordan Justen Date: Mon, 25 Apr 2016 02:38:03 +0000 (-0700) Subject: mesa/gles: Allow format GL_RED to be used with MESA_FORMAT_R_UNORM X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50b82ecd772ff8f59974618f852fedf98bbe77a6;p=mesa.git mesa/gles: Allow format GL_RED to be used with MESA_FORMAT_R_UNORM 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 Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index f69dc6cb3e6..38bd6806056 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: