From cc33082d0033704cf9a9462fa2a02df04ec9fc1c Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Fri, 25 Nov 2022 16:48:17 +0100 Subject: [PATCH] tu/autotune: Always prefer GMEM with fragment density maps If we encounter an app doing bad things where we want sysmem, we can fix that later, but this seems like the right thing to do initially. Part-of: --- src/freedreno/vulkan/tu_autotune.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/freedreno/vulkan/tu_autotune.cc b/src/freedreno/vulkan/tu_autotune.cc index 97c4c82f8dd..5c40bff30cd 100644 --- a/src/freedreno/vulkan/tu_autotune.cc +++ b/src/freedreno/vulkan/tu_autotune.cc @@ -535,6 +535,17 @@ tu_autotune_use_bypass(struct tu_autotune *at, if (cmd_buffer->state.rp.sysmem_single_prim_mode) return false; + /* If the user is using a fragment density map, then this will cause less + * FS invocations with GMEM, which has a hard-to-measure impact on + * performance because it depends on how heavy the FS is in addition to how + * many invocations there were and the density. Let's assume the user knows + * what they're doing when they added the map, because if sysmem is + * actually faster then they could've just not used the fragment density + * map. + */ + if (pass->has_fdm) + return false; + /* For VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT buffers * we would have to allocate GPU memory at the submit time and copy * results into it.