From c46b11438d363f27e9f4418766063c5be9b3e0c2 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 14 May 2020 19:33:18 -0400 Subject: [PATCH] panfrost: Let Gallium pack colours Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_job.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 2d41123c7e9..e79605b4f26 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -1258,19 +1258,13 @@ pan_pack_color(uint32_t *packed, const union pipe_color_union *color, enum pipe_ pan_pack_color_32(packed, (a1 << 31) | (b5 << 25) | (g5 << 15) | (r5 << 5)); } else { - /* Try Gallium's generic default path. Doesn't work for all - * formats but it's a good guess. */ - - union util_color out; - - if (util_format_is_pure_integer(format)) { - memcpy(out.ui, color->ui, 16); - } else { - util_pack_color(color->f, format, &out); - } + /* Otherwise, it's generic subject to replication */ + union util_color out = { 0 }; unsigned size = util_format_get_blocksize(format); + util_pack_color(color->f, format, &out); + if (size == 1) { unsigned b = out.ui[0]; unsigned s = b | (b << 8); -- 2.30.2