From 652ce02ba0a710a80d2232362fa81dac9e55023d Mon Sep 17 00:00:00 2001 From: Jose Maria Casanova Crespo Date: Sat, 13 Sep 2025 00:03:42 +0200 Subject: [PATCH] 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: 5b951bcdd7f ("v3d: Enable Early-Z with discards when depth updates are disabled") Reviewed-by: Iago Toral Quiroga Part-of: (cherry picked from commit 72d7864c6b587c481d549f56ec12f5727f38edab) --- .pick_status.json | 2 +- src/gallium/drivers/v3d/v3d_program.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 0a00ea3a32b..15d1ec0fee3 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index c99c2ad5799..1dd1d6fe99b 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -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;