From 63a5d91c3b1dee977dc79a57fc8bcad9560dd742 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Thu, 1 Aug 2024 20:08:11 -0400 Subject: [PATCH] fix(swapchain): add hash to view_upgrades --- src/mods/swapchain.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mods/swapchain.hpp b/src/mods/swapchain.hpp index bb4421cf..4f66f789 100644 --- a/src/mods/swapchain.hpp +++ b/src/mods/swapchain.hpp @@ -26,6 +26,14 @@ #include "../utils/swapchain.hpp" namespace renodx::mods::swapchain { +struct HashUint32T { + template + inline typename std::uint32_t + operator()(const T value) const { + return static_cast(value); + } +}; + struct SwapChainUpgradeTarget { reshade::api::format old_format = reshade::api::format::r8g8b8a8_unorm; reshade::api::format new_format = reshade::api::format::r16g16b16a16_float; @@ -46,7 +54,11 @@ struct SwapChainUpgradeTarget { bool ignore_reset = false; - std::unordered_map> view_upgrades; + std::unordered_map< + reshade::api::resource_usage, + std::unordered_map, + HashUint32T> + view_upgrades; [[nodiscard]] bool CheckResourceDesc(