panfrost: Squash 22-bit format field in attr_meta
[mesa.git] / src / panfrost / lib / decode.c
index 54f84742b71200a1eb628bccd4b844d3c26ea715..06b381626dc15a91faa23b2da0ce3b6e56e34f95 100644 (file)
@@ -1551,38 +1551,6 @@ pandecode_attribute_meta(int job_no, int count, const struct mali_vertex_tiler_p
                 attr_meta = pandecode_fetch_gpu_mem(attr_mem, p,
                                                     sizeof(*attr_mem));
 
-                /* If the record is discard, it should be zero for everything else */
-
-                if (attr_meta->format == MALI_VARYING_DISCARD) {
-                        uint64_t zero =
-                                attr_meta->index |
-                                attr_meta->unknown1 |
-                                attr_meta->unknown3 |
-                                attr_meta->src_offset;
-
-                        if (zero)
-                                pandecode_msg("XXX: expected empty record for varying discard\n");
-
-                        /* We want to look for a literal 0000 swizzle -- this
-                         * is not encoded with all zeroes, however */
-
-                        enum mali_channel z = MALI_CHANNEL_ZERO;
-                        unsigned zero_swizzle = z | (z << 3) | (z << 6) | (z << 9);
-                        bool good_swizzle = attr_meta->swizzle == zero_swizzle;
-
-                        if (!good_swizzle)
-                                pandecode_msg("XXX: expected zero swizzle for discard\n");
-
-                        if (!varying)
-                                pandecode_msg("XXX: cannot discard attribute\n");
-
-                        /* If we're all good, omit the record */
-                        if (!zero && varying && good_swizzle) {
-                                pandecode_log("/* discarded varying */\n");
-                                continue;
-                        }
-                }
-
                 if (attr_meta->index > max_index)
                         max_index = attr_meta->index;
 
@@ -1591,17 +1559,12 @@ pandecode_attribute_meta(int job_no, int count, const struct mali_vertex_tiler_p
                         pandecode_prop("unknown1 = 0x%" PRIx64, (u64) attr_meta->unknown1);
                 }
 
-                if (attr_meta->unknown3) {
-                        pandecode_msg("XXX: unexpected unknown3 set\n");
-                        pandecode_prop("unknown3 = 0x%" PRIx64, (u64) attr_meta->unknown3);
-                }
-
-                pandecode_log_cont("%s %s_%u", mali_format_as_str(attr_meta->format), prefix, attr_meta->index);
+                pandecode_log_cont("%s %s_%u", mali_format_as_str(attr_meta->format >> 12), prefix, attr_meta->index);
 
                 if (attr_meta->src_offset)
                         pandecode_log_cont("[%u]", attr_meta->src_offset);
 
-                pandecode_swizzle(attr_meta->swizzle, attr_meta->format);
+                pandecode_swizzle(attr_meta->format & ((1 << 12) - 1), attr_meta->format >> 12);
 
                 pandecode_log_cont(";\n");
         }