mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +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 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;
|
std::size_t depth_stencil_hash = 0;
|
||||||
if (key.depth_stencil)
|
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);
|
return color_hash ^ (depth_stencil_hash << 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@ namespace std
|
||||||
{
|
{
|
||||||
|
|
||||||
template <typename T>
|
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
|
std::size_t operator()(const srb2::rhi::Handle<T>& e) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue