Skip to content
Snippets Groups Projects
Commit a6e9df18 authored by Icecream95's avatar Icecream95 Committed by Dylan Baker
Browse files

panfrost: Only write depth / stencil once if MRT is used

We can't assume that RT0 will be written, so this has to be based on
whether a combined store has already been emitted, not the location of
the store.

Emit a non-special combined_store intrinsic that only writes colour
for the other RTs, as reordering stores breaks the Midgard compiler.

Fixes: d37e901e ("pan/mdg: Add new depth store lowering")
Closes: mesa/mesa#6527
Part-of: <mesa/mesa!16685>
(cherry picked from commit a4323b09)
parent 0155e7a1
No related branches found
No related tags found
No related merge requests found
......@@ -634,7 +634,7 @@
"description": "panfrost: Only write depth / stencil once if MRT is used",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d37e901e35a9db2fc5f10558e44fbf8376a174f5"
},
......
......@@ -173,7 +173,12 @@ pan_nir_lower_zs_store(nir_shader *nir)
nir_builder_init(&b, function->impl);
b.cursor = nir_after_block_before_jump(instr->block);
pan_nir_emit_combined_store(&b, intr, writeout | PAN_WRITEOUT_C, stores);
/* Trying to write depth twice results in the
* wrong blend shader being executed on
* Midgard */
unsigned this_store = PAN_WRITEOUT_C | (replaced ? 0 : writeout);
pan_nir_emit_combined_store(&b, intr, this_store, stores);
nir_instr_remove(instr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment