From 7e4d61730e24d01aadfbdeee75dbb1db4c99539c Mon Sep 17 00:00:00 2001 From: Eidolon Date: Fri, 19 May 2023 18:41:43 -0500 Subject: [PATCH] rhi: Fix handle std::hash specialization This prevented hashing of non-const qualified types. The contract for std::hash already implies that it is a callable for an lvalue reference of the template type. --- src/rhi/gl3_core/gl3_core_rhi.hpp | 4 ++-- src/rhi/handle.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rhi/gl3_core/gl3_core_rhi.hpp b/src/rhi/gl3_core/gl3_core_rhi.hpp index 31e85ad1d..b5f499422 100644 --- a/src/rhi/gl3_core/gl3_core_rhi.hpp +++ b/src/rhi/gl3_core/gl3_core_rhi.hpp @@ -46,11 +46,11 @@ struct std::hash { std::size_t operator()(const srb2::rhi::GlCoreFramebufferKey& key) const { - std::size_t color_hash = std::hash>()(key.color); + std::size_t color_hash = std::hash>()(key.color); std::size_t depth_stencil_hash = 0; if (key.depth_stencil) { - depth_stencil_hash = std::hash>()(*key.depth_stencil); + depth_stencil_hash = std::hash>()(*key.depth_stencil); } return color_hash ^ (depth_stencil_hash << 1); } diff --git a/src/rhi/handle.hpp b/src/rhi/handle.hpp index df160c564..282a924da 100644 --- a/src/rhi/handle.hpp +++ b/src/rhi/handle.hpp @@ -314,7 +314,7 @@ namespace std { template -struct hash> +struct hash> { std::size_t operator()(const srb2::rhi::Handle& e) const {