summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-01-04 04:19:28 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-01-04 04:19:28 +0000
commit31955bc4cfe33bd643a866e3bbfc25bbc1e36edc (patch)
treeefeec79c1468b5c6fcdd532006cb141ee5dfede6 /Graphics/GraphicsEngine
parentUpdated some more copyright notices (diff)
downloadDiligentCore-31955bc4cfe33bd643a866e3bbfc25bbc1e36edc.tar.gz
DiligentCore-31955bc4cfe33bd643a866e3bbfc25bbc1e36edc.zip
Fixed minor issue with ResourceMappingImpl::ResMappingHashKey::operator==
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp b/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp
index 39631e7e..e8e04bb1 100644
--- a/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp
+++ b/Graphics/GraphicsEngine/include/ResourceMappingImpl.hpp
@@ -108,7 +108,16 @@ private:
bool operator==(const ResMappingHashKey& RHS) const
{
- return static_cast<const TBase&>(*this) == static_cast<const TBase&>(RHS) && ArrayIndex == RHS.ArrayIndex;
+ if (ArrayIndex != RHS.ArrayIndex)
+ {
+ // We must check array index first because TBase::operator==()
+ // expects that if the hashes are different, the strings must be
+ // different too. This will not be the case for different array
+ // elements of the same variable.
+ return false;
+ }
+
+ return static_cast<const TBase&>(*this) == static_cast<const TBase&>(RHS);
}
const Uint32 ArrayIndex;