[Mesa-dev] [PATCH 3/5] vc4: Add support for 5551 textures.

Eric Anholt eric at anholt.net
Tue May 2 19:33:05 UTC 2017


This keeps us from promoting them up to 8888, at the cost of not being
color-renderable.
---
 src/gallium/drivers/vc4/vc4_formats.c  | 5 ++---
 src/gallium/drivers/vc4/vc4_uniforms.c | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_formats.c b/src/gallium/drivers/vc4/vc4_formats.c
index 42cdad115b27..6d4a6249fbfa 100644
--- a/src/gallium/drivers/vc4/vc4_formats.c
+++ b/src/gallium/drivers/vc4/vc4_formats.c
@@ -94,9 +94,8 @@ static const struct vc4_format vc4_format_table[] = {
         FORMAT(B4G4R4A4_UNORM, NO, RGBA4444, SWIZ(Y, Z, W, X)),
         FORMAT(B4G4R4X4_UNORM, NO, RGBA4444, SWIZ(Y, Z, W, 1)),
 
-        /* It looks like 5551 in the hardware is the other way around from
-         * gallium.
-         */
+        FORMAT(A1B5G5R5_UNORM, NO, RGBA5551, SWIZ(X, Y, Z, W)),
+        FORMAT(X1B5G5R5_UNORM, NO, RGBA5551, SWIZ(X, Y, Z, 1)),
 
         FORMAT(A8_UNORM, NO, ALPHA, SWIZ(0, 0, 0, W)),
         FORMAT(L8_UNORM, NO, ALPHA, SWIZ(W, W, W, 1)),
diff --git a/src/gallium/drivers/vc4/vc4_uniforms.c b/src/gallium/drivers/vc4/vc4_uniforms.c
index 07781b8524ea..5b5d070b5c69 100644
--- a/src/gallium/drivers/vc4/vc4_uniforms.c
+++ b/src/gallium/drivers/vc4/vc4_uniforms.c
@@ -149,6 +149,7 @@ write_texture_border_color(struct vc4_job *job,
                                         PIPE_FORMAT_R8G8B8A8_UNORM, &uc);
                         break;
                 case VC4_TEXTURE_TYPE_RGBA4444:
+                case VC4_TEXTURE_TYPE_RGBA5551:
                         util_pack_color(storage_color,
                                         PIPE_FORMAT_A8B8G8R8_UNORM, &uc);
                         break;
-- 
2.11.0



More information about the mesa-dev mailing list