make chunk build times use frame counter #51

Manually merged
embeddedt merged 1 commits from rdh/celeritas:fix-thing into stonecutter 2026-11-17 09:32:03 -05:00
2 changed files with 4 additions and 2 deletions

No files matched your search

@@ -120,6 +120,8 @@ public abstract class RenderSectionManager {
private boolean blockingResultsPending; private boolean blockingResultsPending;
private int currentFrame;
// Shared by every section (one allocation, not one per section); installed on each RenderSection so its // Shared by every section (one allocation, not one per section); installed on each RenderSection so its
// packedMetadata changes fan out to the list manager mirror(s). // packedMetadata changes fan out to the list manager mirror(s).
private final RenderSection.MetadataSink metadataSink = this::pushSectionMetadata; private final RenderSection.MetadataSink metadataSink = this::pushSectionMetadata;
@@ -576,6 +578,7 @@ public abstract class RenderSectionManager {
// in-flight target. // in-flight target.
if (!this.isInShadowPass()) { if (!this.isInShadowPass()) {
this.builder.tickSchedulingBudget(this.jobMetricsTracker); this.builder.tickSchedulingBudget(this.jobMetricsTracker);
this.currentFrame++;
} }
this.promoteInterimRebuildList(); this.promoteInterimRebuildList();
@@ -809,7 +812,7 @@ public abstract class RenderSectionManager {
private void submitRebuildTasks(ChunkJobCollector collector, ChunkUpdateType type) { private void submitRebuildTasks(ChunkJobCollector collector, ChunkUpdateType type) {
var queue = this.getCurrentRenderListManager().getRebuildLists().byUpdateType().get(type); var queue = this.getCurrentRenderListManager().getRebuildLists().byUpdateType().get(type);
int frame = this.getCurrentRenderListManager().getLastUpdatedFrame(); int frame = this.currentFrame;
int cameraX = (int) Math.floor(this.cameraPosition.x); int cameraX = (int) Math.floor(this.cameraPosition.x);
int cameraY = (int) Math.floor(this.cameraPosition.y); int cameraY = (int) Math.floor(this.cameraPosition.y);
@@ -45,7 +45,6 @@ public class RenderListManager {
@Setter @Setter
private boolean needsUpdate = true; private boolean needsUpdate = true;
@Getter
private int lastUpdatedFrame; private int lastUpdatedFrame;
private int pendingLastUpdatedFrame; private int pendingLastUpdatedFrame;