From 774373cc65c9d0e3feaa72f5da536d5a1abb07cf Mon Sep 17 00:00:00 2001 From: Alessandro Vetere Date: Mon, 10 Dec 2018 21:11:52 +0100 Subject: [PATCH] GSTextureCache: Add ASSERTs on pal value to ease debugging. --- plugins/GSdx/Renderers/Common/GSTextureCache.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/GSdx/Renderers/Common/GSTextureCache.cpp b/plugins/GSdx/Renderers/Common/GSTextureCache.cpp index 9270e0d8b4..b7869c7c54 100644 --- a/plugins/GSdx/Renderers/Common/GSTextureCache.cpp +++ b/plugins/GSdx/Renderers/Common/GSTextureCache.cpp @@ -2092,6 +2092,8 @@ std::size_t GSTextureCache::PaletteKeyHash::operator()(const PaletteKey &key) co uint16 pal = key.pal; const uint32* clut = key.clut; + ASSERT((pal & 15) == 0); + size_t clut_hash = 3831179159; for (uint16 i = 0; i < pal; i += 16) { clut_hash = (clut_hash + 1488000301) ^ (clut[i] + 33644011); @@ -2140,6 +2142,8 @@ GSTextureCache::PaletteMap::PaletteMap(const GSRenderer* renderer) { // Retrieves the palette with the desired clut std::shared_ptr GSTextureCache::PaletteMap::LookupPalette(uint16 pal, bool need_gs_texture) { + ASSERT(pal == 16 || pal == 256); + // Choose which hash map search into: // pal == 16 : index 0 // pal == 256 : index 1