radv: add RADV_GFX12_HIZ_WA to select the HiZ wa behavior on GFX12

Will be useful for benchmarking.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36839>
This commit is contained in:
Samuel Pitoiset
2025-08-19 10:05:09 +02:00
committed by Marge Bot
parent e4ef804013
commit 0c6b39d4fb
2 changed files with 28 additions and 2 deletions

View File

@@ -1612,6 +1612,19 @@ RADV driver environment variables
``peak``
force GPU clocks to their maximum level, this is the default value
.. envvar:: RADV_GFX12_HIZ_WA
choose the specific HiZ workaround to apply on GFX12 (RDNA4). The possible
values are:
``disabled``
no HiZ workaround is enabled, use at your own risk but optimal for performance
``partial``
mitigate the issue partially, potentially risky but performance should be
mostly optimal (default value)
``full``
mitigate the issue completely, no risk but performance might be decreased
.. envvar:: ACO_DEBUG
a comma-separated list of named flags, which do various things:

View File

@@ -2308,8 +2308,21 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm
if (pdev->info.gfx_level == GFX12 && instance->drirc.disable_hiz_his_gfx12)
pdev->use_hiz = false;
if (pdev->info.gfx_level == GFX12)
pdev->gfx12_hiz_wa = RADV_GFX12_HIZ_WA_PARTIAL;
if (pdev->info.gfx_level == GFX12) {
const char *gfx12_hiz_wa_str = getenv("RADV_GFX12_HIZ_WA");
pdev->gfx12_hiz_wa = RADV_GFX12_HIZ_WA_PARTIAL; /* Default */
if (gfx12_hiz_wa_str) {
if (!strcmp(gfx12_hiz_wa_str, "disabled")) {
pdev->gfx12_hiz_wa = RADV_GFX12_HIZ_WA_DISABLED;
} else if (!strcmp(gfx12_hiz_wa_str, "partial")) {
pdev->gfx12_hiz_wa = RADV_GFX12_HIZ_WA_PARTIAL;
} else if (!strcmp(gfx12_hiz_wa_str, "full")) {
pdev->gfx12_hiz_wa = RADV_GFX12_HIZ_WA_FULL;
}
}
}
pdev->use_ngg = (pdev->info.gfx_level >= GFX10 && pdev->info.family != CHIP_NAVI14 &&
!(instance->debug_flags & RADV_DEBUG_NO_NGG)) ||