panfrost: Let Gallium pack colours
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 14 May 2020 23:33:18 +0000 (19:33 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Jun 2020 15:46:23 +0000 (15:46 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5265>

src/gallium/drivers/panfrost/pan_job.c

index 2d41123c7e95d5d26363b1b31d0db1ea7c7c6308..e79605b4f267d30bcd899ff2c2369fd1a462b8a1 100644 (file)
@@ -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);