mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 16:54:04 +00:00
Skip the boundary field for plain floating-island parent lookups
Parent lookups built the whole boundary field per column even where no floating child needs edge distances, and the noise biome cache bound was checked on every insert. Parent lookups now read the biome source directly, and the cache bound is checked only at quart y multiples of 64. Upstream:f2236a8488b5c109d5
This commit is contained in:
1 parent
39e4015b44
commit
8c489e4a26
3 files changed
+8
-13
No files matched your search
+5
-7
@@ -93,20 +93,18 @@ public class FloatingIslandBoundarySamplerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parent_cachesResolvedBiomeColumns() {
|
||||
public void parent_readsOnlyTheQueriedColumnWithoutBuildingTheBoundaryField() {
|
||||
ResourceId parent = ResourceId.parse("ns:parent");
|
||||
ResourceId other = ResourceId.parse("ns:other");
|
||||
AtomicInteger calls = new AtomicInteger();
|
||||
FloatingIslandBoundarySampler sampler = new FloatingIslandBoundarySampler((x, z) -> {
|
||||
calls.incrementAndGet();
|
||||
return parent;
|
||||
return x == 12 && z == -9 ? parent : other;
|
||||
});
|
||||
|
||||
assertSame(parent, sampler.parent(12, -9));
|
||||
int firstReadCount = calls.get();
|
||||
assertSame(parent, sampler.parent(12, -9));
|
||||
assertEquals(firstReadCount, calls.get());
|
||||
int rawWidth = 16 + (FloatingIslandBoundarySampler.EDGE_FADE_RADIUS * 2) + 2;
|
||||
assertEquals(rawWidth * rawWidth, firstReadCount);
|
||||
assertSame(other, sampler.parent(13, -9));
|
||||
assertEquals(2, calls.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user