Skip to content

Commit

Permalink
change pso key hash from 32bit to 64bit
Browse files Browse the repository at this point in the history
32bit is too collision prone
  • Loading branch information
megai2 committed Jan 31, 2021
1 parent 35495f0 commit b88a265
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion d912pxy/d912pxy_pso_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void d912pxy_pso_db::LoadCachedData()
d912pxy_trimmed_pso_desc psoDesc;
if (!psoDesc.DeSerialize(data))
{
LOG_ERR_DTDM("PSO with keyname %08lX have wrong data (old or corrupted)", keyName);
LOG_ERR_DTDM("PSO with keyname %016llX have wrong data (old or corrupted)", keyName);
continue;
}
data.Delete();
Expand Down
4 changes: 2 additions & 2 deletions d912pxy/d912pxy_pso_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void d912pxy_pso_item::CreatePSO(D3D12_GRAPHICS_PIPELINE_STATE_DESC& fullDesc)
};

char fullPsoName[255];
sprintf(fullPsoName, "%016llX_%016llX_%08lX", entryData.vs, entryData.ps, entryData.pso.data());
sprintf(fullPsoName, "%016llX_%016llX_%016llX", entryData.vs, entryData.ps, entryData.pso.data());

LOG_DBG_DTDM("Compiling PSO %S", fullPsoName);

Expand Down Expand Up @@ -521,7 +521,7 @@ void d912pxy_pso_item::RealtimeIntegrityCheck(D3D12_GRAPHICS_PIPELINE_STATE_DESC
{
d912pxy_shader_pair_hash_type pairUID = desc->GetShaderPairUID();
d912pxy_trimmed_pso_desc::StorageKey psoKey(desc->GetValuePart());
sprintf(derivedAlias, "%016llX_%08lX", pairUID, psoKey.val.value);
sprintf(derivedAlias, "%016llX_%016llX", pairUID, psoKey.val.value);
LOG_DBG_DTDM("DX9 PSO realtime check emulation for alias %s", derivedAlias);

derivedName = GetDerivedNameByAlias(derivedAlias);
Expand Down
2 changes: 1 addition & 1 deletion d912pxy/d912pxy_trimmed_pso.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class d912pxy_trimmed_pso_desc
ValuePart val;
ref_part ref;

typedef d912pxy::Memtree<ValuePart, uint32_t, d912pxy::Hash32> IdStorage;
typedef d912pxy::Memtree<ValuePart, uint32_t, d912pxy::Hash64> IdStorage;
typedef IdStorage::PreparedKey StorageKey;

d912pxy_trimmed_pso_desc();
Expand Down
2 changes: 1 addition & 1 deletion d912pxy/d912pxy_vfs_pck.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SOFTWARE.

#define PXY_VFS_PCK_SIGNATURE 0x7670636b
#define PXY_VFS_PCK_INDEX_ROOM 512
#define PXY_VFS_PCK_VER 4
#define PXY_VFS_PCK_VER 5

typedef enum d912pxy_vfs_pck_chunk_type {
CHU_UNDEF,
Expand Down

0 comments on commit b88a265

Please sign in to comment.