From 4ad40094739af2613d9dd6cefefe2dfe32af776c Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sat, 8 Jul 2017 10:51:19 -0400 Subject: [PATCH] a5xx: fix border color for depth formats Signed-off-by: Ilia Mirkin --- src/gallium/drivers/freedreno/a5xx/fd5_emit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_emit.c b/src/gallium/drivers/freedreno/a5xx/fd5_emit.c index c138905cefb..8465389763c 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_emit.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_emit.c @@ -173,7 +173,8 @@ struct PACKED bcolor_entry { uint8_t ui8[4]; int8_t si8[4]; uint32_t rgb10a2; - uint8_t __pad1[36]; + uint32_t z24; /* also s8? */ + uint8_t __pad1[32]; }; #define FD5_BORDER_COLOR_SIZE 0x60 @@ -213,6 +214,7 @@ setup_border_colors(struct fd_texture_stateobj *tex, struct bcolor_entry *entrie e->rgb5a1 = 0; e->rgba4 = 0; e->rgb10a2 = 0; + e->z24 = 0; for (j = 0; j < 4; j++) { int c = desc->swizzle[j]; @@ -275,6 +277,8 @@ setup_border_colors(struct fd_texture_stateobj *tex, struct bcolor_entry *entrie else e->rgb10a2 |= (int)(f_u * 0x3ff) << (c * 10); e->rgba4 |= (int)(f_u * 0xf) << (c * 4); + if (c == 0) + e->z24 = f_u * 0xffffff; } } -- 2.30.2