aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard/disassemble.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-14 13:29:54 -0400
committerMarge Bot <[email protected]>2020-05-21 17:49:14 +0000
commitca48143ec4ba78ea472016add2c7531018549cbe (patch)
treef9995c4816f3fcfae91bcef00de4abdaa904babd /src/panfrost/midgard/disassemble.c
parentf768cb04ed114d7ac65d8bfbaf130002c81448d6 (diff)
pan/mdg: Implement condense_writemask for 8-bit
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
Diffstat (limited to 'src/panfrost/midgard/disassemble.c')
-rw-r--r--src/panfrost/midgard/disassemble.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c
index e97cee163a2..9758904fb6e 100644
--- a/src/panfrost/midgard/disassemble.c
+++ b/src/panfrost/midgard/disassemble.c
@@ -56,8 +56,17 @@ static inline unsigned
condense_writemask(unsigned expanded_mask,
unsigned bits_per_component)
{
- if (bits_per_component == 8)
- unreachable("XXX TODO: sort out how 8-bit constant encoding works");
+ if (bits_per_component == 8) {
+ /* Duplicate every bit to go from 8 to 16-channel wrmask */
+ unsigned omask = 0;
+
+ for (unsigned i = 0; i < 8; ++i) {
+ if (expanded_mask & (1 << i))
+ omask |= (3 << (2 * i));
+ }
+
+ return omask;
+ }
unsigned slots_per_component = bits_per_component / 16;
unsigned max_comp = (16 * 8) / bits_per_component;