From 02f422a14507c30c1828323622d5ac908ff846fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Mon, 16 Feb 2026 13:33:05 +0100 Subject: [PATCH] r300: disable HiZ for PIPE_FUNC_ALWAYS AMD docs support this: R5xx Acceleration v1.5 says safest handling for ZFUNC changes is to disable HiZ except specific LESS/LEQUAL and GREATER/GEQUAL transitions. ATI OpenGL Programming and Optimization Guide advises avoiding ALWAYS when trying to benefit from HiZ so that would imply fglrx also disables HiZ there. On RV530 this fixes the following dEQPs: dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.43 dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.74 Fixes: 12dcbd595467 ("r300g: enable Hyper-Z by default on r500") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8093 (cherry picked from commit b0f019f8cfa42e638d54e3dc46f58083351d0ae1) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/r300/r300_hyperz.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 6cc44186e6d..4e7c23d8763 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3874,7 +3874,7 @@ "description": "r300: disable HiZ for PIPE_FUNC_ALWAYS", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "12dcbd5954676ee32604d82cacbf9a4259967e13", "notes": null diff --git a/src/gallium/drivers/r300/r300_hyperz.c b/src/gallium/drivers/r300/r300_hyperz.c index 8d3eb16f413..6e9cd800c0d 100644 --- a/src/gallium/drivers/r300/r300_hyperz.c +++ b/src/gallium/drivers/r300/r300_hyperz.c @@ -106,6 +106,10 @@ static bool r300_hiz_allowed(struct r300_context *r300) /* if depth func is NOTEQUAL */ if (dsa->dsa.depth_func == PIPE_FUNC_NOTEQUAL) return false; + + /* R5xx docs advise avoiding HiZ with ALWAYS comparisons. */ + if (dsa->dsa.depth_func == PIPE_FUNC_ALWAYS) + return false; } return true; }