Skip to content

Commit a2457f8

Browse files
committed
2.2.2: handle unload first for re-sent chunks
when chunks are re-sent to the client (ex. respawn), sodium marks each section to be unloaded and then reloaded. the immediate rebuilds were processed before processing the unload queue, so the occlusion cache for prioritized chunks would be set to that of ChunkRenderData.ABSENT after the forced rebuild
1 parent 174daf4 commit a2457f8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ org.gradle.jvmargs = -Xmx2G
22
org.gradle.parallel = true
33
org.gradle.caching = true
44

5-
mod_version = 2.2.1
5+
mod_version = 2.2.2
66

77
minecraft_version = 1.16.5
88
yarn_mappings = 1.16.5+build.9

src/main/java/me/jellysquid/mods/sodium/client/render/SodiumWorldRenderer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ public void updateChunks(Camera camera, Frustum frustum, boolean hasForcedFrustu
179179
this.lastCameraPitch = pitch;
180180
this.lastCameraYaw = yaw;
181181

182+
this.chunkRenderManager.unloadPending();
183+
182184
profiler.swap("chunk_update");
183185

184186
this.chunkRenderManager.updateChunks();

src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public ChunkRenderManager(SodiumWorldRenderer renderer, ChunkRenderBackend<T> ba
117117

118118
public void update(Camera camera, FrustumExtended frustum, int frame, boolean spectator) {
119119
this.reset();
120-
this.unloadPending();
121120

122121
this.setup(camera);
123122
this.iterateChunks(camera, frustum, frame, spectator);
@@ -286,7 +285,7 @@ private void reset() {
286285
this.visibleChunkCount = 0;
287286
}
288287

289-
private void unloadPending() {
288+
public void unloadPending() {
290289
while (!this.unloadQueue.isEmpty()) {
291290
this.unloadQueue.dequeue()
292291
.delete();

0 commit comments

Comments
 (0)