mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-08 07:51:19 +12:00
include color format data types in ps hash
This commit is contained in:
parent
8a74445a96
commit
cd72ad80d2
6 changed files with 49 additions and 19 deletions
|
@ -14,6 +14,9 @@
|
|||
#include "config/ActiveSettings.h"
|
||||
#include "Cafe/GameProfile/GameProfile.h"
|
||||
#include "util/containers/flat_hash_map.hpp"
|
||||
#if BOOST_OS_MACOS
|
||||
#include "Cafe/HW/Latte/Renderer/Metal/LatteToMtl.h"
|
||||
#endif
|
||||
#include <cinttypes>
|
||||
|
||||
// experimental new decompiler (WIP)
|
||||
|
@ -544,6 +547,20 @@ void LatteSHRC_UpdatePSBaseHash(uint8* pixelShaderPtr, uint32 pixelShaderSize, b
|
|||
_calculateShaderProgramHash(psProgramCode, pixelShaderSize, &hashCachePS, &psHash1, &psHash2);
|
||||
// get vertex shader
|
||||
uint64 psHash = psHash1 + psHash2 + _activePSImportTable.key + (usesGeometryShader ? hashCacheGS.prevHash1 : 0ULL);
|
||||
|
||||
#if BOOST_OS_MACOS
|
||||
if (g_renderer->GetType() == RendererAPI::Metal)
|
||||
{
|
||||
for (uint8 i = 0; i < LATTE_NUM_COLOR_TARGET; i++)
|
||||
{
|
||||
auto format = LatteMRT::GetColorBufferFormat(i, LatteGPUState.contextNew);
|
||||
uint8 dataType = (uint8)GetMtlPixelFormatInfo(format, false).dataType;
|
||||
psHash += (uint64)dataType;
|
||||
psHash = std::rotl<uint64>(psHash, 7);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
_shaderBaseHash_ps = psHash;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue