aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-14 19:33:18 -0400
committerMarge Bot <[email protected]>2020-06-01 15:46:23 +0000
commitc46b11438d363f27e9f4418766063c5be9b3e0c2 (patch)
tree11c22d403d64658bd0a7fcb911ab566d47ffd2f4 /src/gallium/drivers
parent8dc8b6640334e94f4f8b66a93c68e49c04b06623 (diff)
panfrost: Let Gallium pack colours
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5265>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/panfrost/pan_job.c14
1 files 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);