From 2ca56d5f3f148c7cf4ee3baf10e8aca7f539889c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Fri, 24 Aug 2018 08:18:12 +0300 Subject: [PATCH] mesa: allow UNSIGNED_BYTE reads for snorm surfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenGL ES 3.1 specification (16.1 Reading Pixels): "For normalized fixed-point rendering surfaces, the combination format RGBA and type UNSIGNED_BYTE is accepted." Also, disallow GL_R8_SNORM, GL_RG8_SNORM reads with GL_BYTE. But why? Signed-off-by: Tapani Pälli --- src/mesa/main/readpix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 2cbb578a37f..e2ae489c815 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -950,6 +950,13 @@ read_pixels_es3_error_check(struct gl_context *ctx, GLenum format, GLenum type, } } if (type == GL_BYTE) { + switch (internalFormat) { + case GL_RGBA8_SNORM: + if (_mesa_has_EXT_render_snorm(ctx)) + return GL_NO_ERROR; + } + } + if (type == GL_UNSIGNED_BYTE) { switch (internalFormat) { case GL_R8_SNORM: case GL_RG8_SNORM: -- 2.14.4