v3d: Fix fbfetch with discards.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

We can't do earlyz_with_discard when using fbfetch as we can have TLB reads
that occur before the discard. This can result in implicit Z writes which make
the setmsf instruction emitted as a result of the discard invalid.

Fixes: 332b313547 ("v3d: enable framebuffer fetch")

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34151>
This commit is contained in:
Ella Stanforth 2025-03-21 10:05:44 +00:00 committed by Marge Bot
parent ab63b92b3c
commit 53484dc64a

View file

@ -675,6 +675,7 @@ v3d_update_compiled_fs(struct v3d_context *v3d, uint8_t prim_mode)
key->swap_color_rb = v3d->swap_color_rb;
key->can_earlyz_with_discard = s->info.fs.uses_discard &&
!s->info.fs.uses_fbfetch_output &&
(!v3d->zsa || !job->zsbuf || !v3d->zsa->base.depth_enabled ||
!v3d->zsa->base.depth_writemask) &&
!(v3d->active_queries && v3d->current_oq);