Update xxHash to 0.8.3 + Use faster algorithm#1879
Merged
flyinghead merged 1 commit intoflyinghead:devfrom Mar 22, 2025
Merged
Conversation
flyinghead
reviewed
Mar 22, 2025
| { | ||
| u32 hash = XXH32(ram, 0x10000, 0); | ||
| u32 hash = XXH3_64bits(ram, 0x10000); | ||
| LOGJVS("JVS Firmware hash %08x\n", hash); |
Owner
There was a problem hiding this comment.
Previous hash values must be preserved here. See the following lines.
flyinghead
reviewed
Mar 22, 2025
core/rend/TexCache.cpp
Outdated
| // with existing custom texture packs. | ||
| int oldSize = width * height / 8; | ||
| old_vqtexture_hash = XXH32(&vram[mmStartAddress - VQ_CODEBOOK_SIZE], oldSize, 7); | ||
| old_vqtexture_hash = XXH3_64bits(&vram[mmStartAddress - VQ_CODEBOOK_SIZE], oldSize); |
Owner
There was a problem hiding this comment.
Changing the hash value will invalidate all existing texture packs. Obviously we don't want that.
flyinghead
reviewed
Mar 22, 2025
core/rend/texconv.cpp
Outdated
| pal_hash_16[i] = XXH3_64bits(&PALETTE_RAM[i << 4], 16 * 4); | ||
| for (std::size_t i = 0; i < std::size(pal_hash_256); i++) | ||
| pal_hash_256[i] = XXH32(&PALETTE_RAM[i << 8], 256 * 4, 7); | ||
| pal_hash_256[i] = XXH3_64bits(&PALETTE_RAM[i << 8], 256 * 4); |
Owner
There was a problem hiding this comment.
The palette hash is used in the calculation of texture hashes, so we don't want it to change either.
Contributor
Author
|
@flyinghead Done. |
flyinghead
reviewed
Mar 22, 2025
core/rend/TexCache.cpp
Outdated
| XXH32_state_t *state = XXH32_createState(); | ||
| XXH32_reset(state, 7); | ||
| XXH3_state_t *state = XXH3_createState(); | ||
| XXH3_64bits_reset(state); |
Owner
There was a problem hiding this comment.
All the changes in this file must be reverted to preserve existing texture hash values.
Contributor
Author
|
It should be good now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rework of #1872 for the dev branch