mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-09 04:36:23 +00:00
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.
This commit is contained in:
parent
8d390c58d4
commit
7e4d61730e
2 changed files with 3 additions and 3 deletions
|
|
@ -46,11 +46,11 @@ struct std::hash<srb2::rhi::GlCoreFramebufferKey>
|
|||
{
|
||||
std::size_t operator()(const srb2::rhi::GlCoreFramebufferKey& key) const
|
||||
{
|
||||
std::size_t color_hash = std::hash<const srb2::rhi::Handle<srb2::rhi::Texture>>()(key.color);
|
||||
std::size_t color_hash = std::hash<srb2::rhi::Handle<srb2::rhi::Texture>>()(key.color);
|
||||
std::size_t depth_stencil_hash = 0;
|
||||
if (key.depth_stencil)
|
||||
{
|
||||
depth_stencil_hash = std::hash<const srb2::rhi::Handle<srb2::rhi::Renderbuffer>>()(*key.depth_stencil);
|
||||
depth_stencil_hash = std::hash<srb2::rhi::Handle<srb2::rhi::Renderbuffer>>()(*key.depth_stencil);
|
||||
}
|
||||
return color_hash ^ (depth_stencil_hash << 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ namespace std
|
|||
{
|
||||
|
||||
template <typename T>
|
||||
struct hash<const srb2::rhi::Handle<T>>
|
||||
struct hash<srb2::rhi::Handle<T>>
|
||||
{
|
||||
std::size_t operator()(const srb2::rhi::Handle<T>& e) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue