From ae62fb3737634fdf1c376f3d27c2eae5b751dccc Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Thu, 18 Mar 2021 20:02:22 +1300 Subject: [PATCH] panfrost: Disable early-z when alpha test is used Fixes rendering artefacts in Minetest on Midgard. Fixes: 275277a2b48 ("panfrost: Implement alpha testing natively") Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index aeffdf2..afb381c 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -490,7 +490,8 @@ panfrost_prepare_midgard_fs_state(struct panfrost_context *ctx, /* Reasons to disable early-Z from a shader perspective */ bool late_z = fs->info.fs.can_discard || fs->info.writes_global || - fs->info.fs.writes_depth || fs->info.fs.writes_stencil; + fs->info.fs.writes_depth || fs->info.fs.writes_stencil || + (zsa->alpha_func != MALI_FUNC_ALWAYS); /* If either depth or stencil is enabled, discard matters */ bool zs_enabled = -- 2.7.4