Mesa (master): mesa/texformat: Handle GL_RGBA + GL_UNSIGNED_SHORT_5_5_5_1

Chad Versace chadversary at kemper.freedesktop.org
Tue Dec 27 17:40:02 UTC 2016


Module: Mesa
Branch: master
Commit: f3739810e337d0f03514b9b967594c8dc010dfa4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f3739810e337d0f03514b9b967594c8dc010dfa4

Author: Chad Versace <chadversary at chromium.org>
Date:   Thu Dec 22 14:39:44 2016 -0800

mesa/texformat: Handle GL_RGBA + GL_UNSIGNED_SHORT_5_5_5_1

_mesa_choose_tex_format() already handles GL_RGBA + GL_UNSIGNED_SHORT_1_5_5_5_REV
by converting it to MESA_FORMAT_B5G5R5A1_UNORM. Teach it do the same for
the non-reversed type. Otherwise, the switch's fallthrough converts it
to an 8888 format, which has incompatible precision in the alpha
channel.

Patch 2/2 to fix dEQP-EGL.functional.image.modify.tex_rgb5_a1_tex_subimage_rgba8
on Intel.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99185
Cc: Haixia Shi <hshi at chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Cc: "13.0" <mesa-stable at lists.freedesktop.org>

---

 src/mesa/main/texformat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index be2581b..baa3988 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -74,6 +74,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
          RETURN_IF_SUPPORTED(MESA_FORMAT_B4G4R4A4_UNORM);
       } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
          RETURN_IF_SUPPORTED(MESA_FORMAT_B5G5R5A1_UNORM);
+      } else if (type == GL_UNSIGNED_SHORT_5_5_5_1) {
+         RETURN_IF_SUPPORTED(MESA_FORMAT_B5G5R5A1_UNORM);
       } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
          RETURN_IF_SUPPORTED(MESA_FORMAT_B10G10R10A2_UNORM);
       }




More information about the mesa-commit mailing list