From 3ce6bcb9e8ccde7c543816baeada2912f5a47bda Mon Sep 17 00:00:00 2001 From: "Eric R. Smith" Date: Wed, 3 Dec 2025 13:34:14 -0400 Subject: [PATCH] panfrost: do not allow skipping of fragment shader when alpha-to-coverage When alpha to coverage is enabled we cannot allow the fragment shader to be skipped, because the calculated alpha result is essentially a side effect (it can cause some samples to be discarded). This brings the OpenGL driver in line with panvk, which already has this check in its version of fs_required(). Signed-off-by: Eric R. Smith Reviewed-by: Iago Toral Quiroga Reviewed-by: Erik Faye-Lund Cc: mesa-stable Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.h b/src/gallium/drivers/panfrost/pan_cmdstream.h index 627f53e9193..7b426ac9d47 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.h +++ b/src/gallium/drivers/panfrost/pan_cmdstream.h @@ -225,6 +225,11 @@ panfrost_fs_required(struct panfrost_compiled_shader *fs, if (fs->info.fs.sidefx) return true; + /* If alpha to coverage is enabled we need to execute, as + * writing the pixel can modify occlusion query results. */ + if (blend->base.alpha_to_coverage) + return true; + /* Using an empty FS requires early-z to be enabled, but alpha test * needs it disabled. Alpha test is only native on Midgard, so only * check there.