diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-20 13:33:39 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-21 08:40:54 -0700 |
commit | a94fb781c28e2b865fafcf8811558a0c928cce7b (patch) | |
tree | 2c8147a002608b1f69719c6a6272e2e877151d4e /src/panfrost/pandecode | |
parent | c0642ebca1a8aa7fa34eb5c5205babf9e9a7b6a2 (diff) |
pan/decode: Handle VARYING_DISCARD
Varying discard is not used by Panfrost, but the blob uses it sometimes
to have some padding in the varyings table, probably to minimize
per-draw overhead. (...We should maybe consider this ourselves!)
Let's check for this and ensure the rest of the record is consistent
with a discarded varying.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/pandecode')
-rw-r--r-- | src/panfrost/pandecode/decode.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index 8fc18b2ee74..208f4103c75 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -1387,6 +1387,38 @@ 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; + } + } + pandecode_log("{\n"); pandecode_indent++; pandecode_prop("index = %d", attr_meta->index); |