From 494e4b5f802b74a6b03773d4e74bfe0ec51a2340 Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Tue, 1 Aug 2017 16:49:17 -0400 Subject: [PATCH] Fixed loading GL_RGB10_A2UI texture format MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The GL_RGB10_A2UI was being unpacked as a double sized version of GL_UNSIGNED_SHORT_5_5_5_1, which it is not. The channels are not stored in the same order for these 2 formats. This fixes all "rgb10_a2ui" related test in: dEQP-GLES3.functional.texture.format.sized.* dEQP-GLES3.functional.texture.specification.* Change-Id: I0d398d0537a440906e9ef3aeb01fe4e782f778b6 Reviewed-on: https://swiftshader-review.googlesource.com/11168 Tested-by: Alexis Hétu Reviewed-by: Nicolas Capens --- src/OpenGL/common/Image.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenGL/common/Image.cpp b/src/OpenGL/common/Image.cpp index d3fe20efe..f75f92f3c 100644 --- a/src/OpenGL/common/Image.cpp +++ b/src/OpenGL/common/Image.cpp @@ -263,10 +263,10 @@ namespace for(int x = 0; x < width; x++) { unsigned int rgba = source1010102U[x]; - dest16U[4 * x + 0] = (rgba & 0x00000FFC) >> 2; - dest16U[4 * x + 1] = (rgba & 0x003FF000) >> 12; - dest16U[4 * x + 2] = (rgba & 0xFFC00000) >> 22; - dest16U[4 * x + 3] = (rgba & 0x00000003); + dest16U[4 * x + 0] = (rgba & 0x000003FF); + dest16U[4 * x + 1] = (rgba & 0x000FFC00) >> 10; + dest16U[4 * x + 2] = (rgba & 0x3FF00000) >> 20; + dest16U[4 * x + 3] = (rgba & 0xC0000000) >> 30; } } -- 2.11.0