Skip to content

Commit

Permalink
fix(swapchain): add hash to view_upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Aug 2, 2024
1 parent b91b605 commit 63a5d91
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/mods/swapchain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
#include "../utils/swapchain.hpp"

namespace renodx::mods::swapchain {
struct HashUint32T {
template <typename T>
inline typename std::uint32_t
operator()(const T value) const {
return static_cast<std::uint32_t>(value);
}
};

struct SwapChainUpgradeTarget {
reshade::api::format old_format = reshade::api::format::r8g8b8a8_unorm;
reshade::api::format new_format = reshade::api::format::r16g16b16a16_float;
Expand All @@ -46,7 +54,11 @@ struct SwapChainUpgradeTarget {

bool ignore_reset = false;

std::unordered_map<reshade::api::resource_usage, std::unordered_map<reshade::api::format, reshade::api::format>> view_upgrades;
std::unordered_map<
reshade::api::resource_usage,
std::unordered_map<reshade::api::format, reshade::api::format>,
HashUint32T>
view_upgrades;

[[nodiscard]]
bool CheckResourceDesc(
Expand Down

0 comments on commit 63a5d91

Please sign in to comment.