diff options
| author | Stenzek <stenzek@gmail.com> | 2019-10-02 21:32:44 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2019-10-02 21:34:58 +1000 |
| commit | 328d89db708ec9c1d3e31a760f530b64c4767b2b (patch) | |
| tree | 034ca9bb6821894034f3060e28ddc4bb2a04e694 /Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | |
| parent | c557aa4a15b577fdaf2f5de71078c41037aea01e (diff) | |
Vulkan: Add a DriverDetails bug for "slow cached readback memory"
Using the cached memory type appears to be slower on Mali drivers, with
~10-15% CPU spent in the __pi___inval_cache_range kernel function.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/VulkanContext.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp index 6a8256b683..72eddd56c9 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp +++ b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp @@ -775,6 +775,16 @@ u32 VulkanContext::GetReadbackMemoryType(u32 bits, bool* is_coherent) { std::optional<u32> type_index; + // Mali driver appears to be significantly slower for readbacks when using cached memory. + if (DriverDetails::HasBug(DriverDetails::BUG_SLOW_CACHED_READBACK_MEMORY)) + { + type_index = GetMemoryType( + bits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, true, + is_coherent); + if (type_index) + return type_index.value(); + } + // Optimal config uses cached+coherent. type_index = GetMemoryType(bits, |
