From 72d7864c6b587c481d549f56ec12f5727f38edab 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: --- src/gallium/drivers/v3d/v3d_program.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c index e9f1ec4f6d5..884c7f8c508 100644 --- a/src/gallium/drivers/v3d/v3d_program.c +++ b/src/gallium/drivers/v3d/v3d_program.c @@ -628,8 +628,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;