mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-27 06:20:02 +00:00
Spread native volume cache keys
- Mix chunk keys so origin and query caches stop treeifying buckets
This commit is contained in:
1 parent
2f8d3b1d1a
commit
8878e9aa5f
2 files changed
+32
No files matched your search
@@ -8,6 +8,7 @@ import art.arcane.volmlib.nativelib.terrain.structure.NativeStructureVolume;
|
||||
import art.arcane.iris.generation.runtime.IrisEngine;
|
||||
import art.arcane.iris.generation.runtime.Engine;
|
||||
import art.arcane.iris.world.history.GenerationHistoryRuntimeRouter;
|
||||
import art.arcane.volmlib.util.cache.CacheKey;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -313,7 +314,15 @@ public final class NativeStructureVolumeIndex {
|
||||
};
|
||||
}
|
||||
|
||||
static int runtimeChunkHash(int runtimeId, long chunkKey) {
|
||||
return Long.hashCode(CacheKey.mix(chunkKey)) * 31 + runtimeId;
|
||||
}
|
||||
|
||||
private record RuntimeChunkKey(int runtimeId, long chunkKey) {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return runtimeChunkHash(runtimeId, chunkKey);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user