diff options
author | Boris Brezillon <[email protected]> | 2020-01-31 10:05:16 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-05 15:41:55 +0000 |
commit | e1ba0cd452cb456e5d06ee22fdecaed451a7a48b (patch) | |
tree | 0149c6b7b55e4721049674229357db13730dd3a8 /src/panfrost/midgard/mir.c | |
parent | f5619f50738c0ea2bee49d982e88f18496d7514a (diff) |
pan/midgard: Add nir_intrinsic_store_zs_output_pan support
ZS fragment stores are done like color fragment stores, except it's
using a different RT id (0xFF), the depth and stencil values are stored
in r1.x and r1.y.
Signed-off-by: Boris Brezillon <[email protected]>
[Fix the scheduling part]
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3697>
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)) |