[Perf] (Magma): wire draws memoise each unit's sampler and skip rebinding an unchanged pipeline, vertex or index binding (rd12 monolith 57.9 -> 60.3 fps).

This commit is contained in:
2026-10-07 10:50:38 -04:00
parent b556ec3134
commit 4ef9705ee0
6 changed files with 113 additions and 8 deletions
@@ -274,6 +274,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
}
void VkSamplerManager::Shutdown() {
++m_destroyEpoch;
for (auto& [_, sampler] : m_samplers) {
if (m_device != VK_NULL_HANDLE && sampler.handle != VK_NULL_HANDLE) {
vkDestroySampler(m_device, sampler.handle, nullptr);
@@ -309,6 +310,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
if (m_device != VK_NULL_HANDLE && entry.handle != VK_NULL_HANDLE) {
vkDestroySampler(m_device, entry.handle, nullptr);
}
++m_destroyEpoch;
if (entry.usesCustomBorderColor && m_customBorderColorSamplerCount > 0) {
--m_customBorderColorSamplerCount;
}