GSTextureCache: Compare also pal value in PaletteKey eq operator.

This commit is contained in:
Alessandro Vetere 2018-12-10 21:12:42 +01:00 committed by lightningterror
parent 774373cc65
commit e1dff69a43
1 changed files with 5 additions and 5 deletions

View File

@ -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