vc4: Add support for 5551 textures.
authorEric Anholt <eric@anholt.net>
Mon, 1 May 2017 18:25:06 +0000 (11:25 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 10 Oct 2017 16:31:29 +0000 (09:31 -0700)
This keeps us from promoting them up to 8888, at the cost of not being
color-renderable.

src/gallium/drivers/vc4/vc4_formats.c
src/gallium/drivers/vc4/vc4_uniforms.c

index 42cdad115b2786646bf5dfd7950229e207a09701..6d4a6249fbfa146c2c92a4c9cb3b590cee75ffcf 100644 (file)
@@ -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)),
index b8169347fedd1b9678d8922e3ff847aa6ebc29af..12e6504bba0a7cff6c3145c0e4ca38874ac2cc40 100644 (file)
@@ -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;