mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 16:10:09 +01:00
agx: Fix discard with MRT
The exact semantics of sample_mask aren't quite clear to me yet, but executing multiple sample_mask instructions seems to raise a fault :| Fixes SuperTuxKart's advanced renderer. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20446>
This commit is contained in:
parent
2b5519e865
commit
ebe40b15ea
2 changed files with 3 additions and 2 deletions
|
|
@ -455,13 +455,14 @@ agx_emit_local_store_pixel(agx_builder *b, nir_intrinsic_instr *instr)
|
|||
agx_writeout(b, 0x000C);
|
||||
}
|
||||
|
||||
if (b->shader->nir->info.fs.uses_discard) {
|
||||
if (b->shader->nir->info.fs.uses_discard && !b->shader->did_sample_mask) {
|
||||
/* If the shader uses discard, the sample mask must be written by the
|
||||
* shader on all exeuction paths. If we've reached the end of the shader,
|
||||
* we are therefore still active and need to write a full sample mask.
|
||||
* TODO: interactions with MSAA and gl_SampleMask writes
|
||||
*/
|
||||
agx_sample_mask(b, agx_immediate(1));
|
||||
b->shader->did_sample_mask = true;
|
||||
}
|
||||
|
||||
/* Compact the registers according to the mask */
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ typedef struct {
|
|||
unsigned alloc;
|
||||
|
||||
/* I don't really understand how writeout ops work yet */
|
||||
bool did_writeout;
|
||||
bool did_writeout, did_sample_mask;
|
||||
|
||||
/* Has r0l been zeroed yet due to control flow? */
|
||||
bool any_cf;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue