From e1dff69a436d776c4b76d2e36eb9b9465cd9afa9 Mon Sep 17 00:00:00 2001 From: Alessandro Vetere Date: Mon, 10 Dec 2018 21:12:42 +0100 Subject: [PATCH] GSTextureCache: Compare also pal value in PaletteKey eq operator. --- plugins/GSdx/Renderers/Common/GSTextureCache.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/GSdx/Renderers/Common/GSTextureCache.cpp b/plugins/GSdx/Renderers/Common/GSTextureCache.cpp index b7869c7c54..c5b3d3bd01 100644 --- a/plugins/GSdx/Renderers/Common/GSTextureCache.cpp +++ b/plugins/GSdx/Renderers/Common/GSTextureCache.cpp @@ -2123,11 +2123,11 @@ std::size_t GSTextureCache::PaletteKeyHash::operator()(const PaletteKey &key) co // Compare clut contents bool GSTextureCache::PaletteKeyEqual::operator()(const PaletteKey &lhs, const PaletteKey &rhs) const { - ASSERT(lhs.pal == rhs.pal); // By design, each map SHOULD contain only PaletteKey with the same pal value - - uint16 pal = lhs.pal; - uint16 palette_size = pal * sizeof(uint32); - return GSVector4i::compare64(lhs.clut, rhs.clut, palette_size); + if (lhs.pal != rhs.pal) { + return false; + } + + return GSVector4i::compare64(lhs.clut, rhs.clut, lhs.pal * sizeof(lhs.clut[0])); }; // GSTextureCache::PaletteMap