From 75f02ed4b5de46e9cc5049e6046cb767ebbc5543 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 19 Sep 2024 16:16:39 -0400 Subject: [PATCH] anv: Set shader_spilling_rate=15 by default This avoids massively long shader compile times when there is lots of spilling, at a minor cost of a few more spills/fills. Choose 15 as it is already the default used by the Cyberpunk 2077 driconf workaround. Surprisingly the number of additional spills/fills are miniscule in fossil-db: Instructions in all programs: 152680595 -> 152681525 (+0.0%) SENDs in all programs: 7672789 -> 7672789 (+0.0%) Loops in all programs: 48469 -> 48469 (+0.0%) Cycles in all programs: 11981743456 -> 11984228708 (+0.0%) Spills in all programs: 42989 -> 42779 (-0.5%) Fills in all programs: 76380 -> 76776 (+0.5%) partly because of the chaotic unpredictability that the choice of registe to spill has on a shader. For example, this patch massively helps some shaders in terms of spills/fills: Spills helped fossils/fossil-db/steam-native/red_dead_redemption2.vk-g6.foz/4101ff9c9b83bf22/SIMD8 fragment: 3208 -> 2894 (-9.8%) Fills helped fossils/fossil-db/steam-native/red_dead_redemption2.vk-g6.foz/4101ff9c9b83bf22/SIMD8 fragment: 7258 -> 6795 (-6.4%) Spills helped fossils/q2rtx/q2rtx-rt-pipeline.976f4ab1c0fee975.1.foz/c496e8a549f6b4bf/compute: 109 -> 92 (-15.6%) Related: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31133 Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9241 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11709 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11844 Part-of: --- src/intel/vulkan/anv_instance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_instance.c b/src/intel/vulkan/anv_instance.c index 406449d0f8b..ec109fe6c84 100644 --- a/src/intel/vulkan/anv_instance.c +++ b/src/intel/vulkan/anv_instance.c @@ -31,7 +31,7 @@ static const driOptionDescription anv_dri_options[] = { DRI_CONF_ANV_QUERY_CLEAR_WITH_BLORP_THRESHOLD(6) DRI_CONF_ANV_QUERY_COPY_WITH_SHADER_THRESHOLD(6) DRI_CONF_ANV_FORCE_INDIRECT_DESCRIPTORS(false) - DRI_CONF_SHADER_SPILLING_RATE(0) + DRI_CONF_SHADER_SPILLING_RATE(15) DRI_CONF_OPT_B(intel_tbimr, true, "Enable TBIMR tiled rendering") DRI_CONF_ANV_COMPRESSION_CONTROL_ENABLED(false) DRI_CONF_ANV_FAKE_NONLOCAL_MEMORY(false)