diff options
Diffstat (limited to 'src/panfrost/midgard/mir.c')
-rw-r--r-- | src/panfrost/midgard/mir.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c index 5241c6334b2..5e9acc05dbd 100644 --- a/src/panfrost/midgard/mir.c +++ b/src/panfrost/midgard/mir.c @@ -468,9 +468,19 @@ mir_bytemask_of_read_components_single(unsigned *swizzle, unsigned inmask, midga uint16_t mir_bytemask_of_read_components_index(midgard_instruction *ins, unsigned i) { - /* Branch writeout uses all components */ - if (ins->compact_branch && ins->writeout && (i == 0)) - return 0xFFFF; + if (ins->compact_branch && ins->writeout && (i == 0)) { + /* Non-ZS writeout uses all components */ + if (!ins->writeout_depth && !ins->writeout_stencil) + return 0xFFFF; + + /* For ZS-writeout, if both Z and S are written we need two + * components, otherwise we only need one. + */ + if (ins->writeout_depth && ins->writeout_stencil) + return 0xFF; + else + return 0xF; + } /* Conditional branches read one 32-bit component = 4 bytes (TODO: multi branch??) */ if (ins->compact_branch && ins->branch.conditional && (i == 0)) |