v3d: Don't enable Early-z with discards when stencil updates are enabled

This fixes font rendering artifacts when Chromium/Firefox use Office365
PowerPoint set into fullscreen presentation mode.

Fixes: 5b951bcdd7 ("v3d: Enable Early-Z with discards when depth updates are disabled")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37349>
(cherry picked from commit 72d7864c6b)
This commit is contained in:
Jose Maria Casanova Crespo 2025-09-13 00:03:42 +02:00 committed by Eric Engestrom
parent f70ac948b9
commit 652ce02ba0
2 changed files with 7 additions and 3 deletions

View file

@ -4614,7 +4614,7 @@
"description": "v3d: Don't enable Early-z with discards when stencil updates are enabled",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "5b951bcdd7faf1cbfc189a953c33334378ada3df",
"notes": null

View file

@ -625,8 +625,12 @@ v3d_update_compiled_fs(struct v3d_context *v3d, uint8_t prim_mode)
key->can_earlyz_with_discard = s->info.fs.uses_discard &&
!s->info.fs.uses_fbfetch_output &&
(!v3d->zsa || !job->zsbuf.texture ||
!v3d->zsa->base.depth_enabled ||
!v3d->zsa->base.depth_writemask) &&
((!v3d->zsa->base.depth_enabled ||
!v3d->zsa->base.depth_writemask) &&
(!v3d->zsa->base.stencil[0].enabled ||
!v3d->zsa->base.stencil[0].writemask) &&
(!v3d->zsa->base.stencil[1].enabled ||
!v3d->zsa->base.stencil[1].writemask))) &&
!(v3d->active_queries && v3d->current_oq);
key->software_blend = v3d->blend->use_software;