pan/bi: Handle discard/branch in get_component_count
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 1 May 2020 22:36:51 +0000 (18:36 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 4 May 2020 15:08:16 +0000 (11:08 -0400)
No dest requires special handling.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>

src/panfrost/bifrost/bir.c

index 923815b15246003619c09c8b7fccc3a50eec2fe9..5cdbda89bb88caa885897ca6cde9875f548df4ea 100644 (file)
@@ -96,6 +96,11 @@ bi_from_bytemask(uint16_t bytemask, unsigned bytes)
 unsigned
 bi_get_component_count(bi_instruction *ins, signed src)
 {
+        /* Discards and branches are oddball since they're not BI_VECTOR but no
+         * destination. So special case.. */
+        if (ins->type == BI_DISCARD || ins->type == BI_BRANCH)
+                return 1;
+
         if (bi_class_props[ins->type] & BI_VECTOR) {
                 assert(ins->vector_channels);
                 return (src <= 0) ? ins->vector_channels : 1;