From cbb532429b68ce0e401413bdcc75a2f122786302 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 1 May 2017 11:25:06 -0700 Subject: vc4: Add support for 5551 textures. 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 42cdad115b2..6d4a6249fbf 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 b8169347fed..12e6504bba0 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; -- cgit v1.2.3