move frex check loop

This commit is contained in:
mcrcortex
2025-06-17 12:52:55 +10:00
parent dc6dd4bb11
commit 144faf5b21
2 changed files with 14 additions and 9 deletions

View File

@@ -106,6 +106,18 @@ public class RenderService<T extends AbstractSectionRenderer<J, Q>, J extends Vi
this.modelService.tick(budget); this.modelService.tick(budget);
} }
private boolean frexStillHasWork() {
if (!VoxyClient.isFrexActive()) {
return false;
}
//If frex is running we must tick everything to ensure correctness
UploadStream.INSTANCE.tick();
//Done here as is allows less gl state resetup
this.modelService.tick(100_000_000);
glFinish();
return this.nodeManager.hasWork() || this.renderGen.getTaskCount()!=0 || !this.modelService.areQueuesEmpty();
}
public void renderFarAwayOpaque(J viewport, GlTexture depthBoundTexture) { public void renderFarAwayOpaque(J viewport, GlTexture depthBoundTexture) {
//LightMapHelper.tickLightmap(); //LightMapHelper.tickLightmap();
@@ -168,14 +180,7 @@ public class RenderService<T extends AbstractSectionRenderer<J, Q>, J extends Vi
this.traversal.doTraversal(viewport); this.traversal.doTraversal(viewport);
TimingStatistics.I.stop(); TimingStatistics.I.stop();
} while (this.frexStillHasWork());
if (VoxyClient.isFrexActive()) {//If frex is running we must tick everything to ensure correctness
UploadStream.INSTANCE.tick();
//Done here as is allows less gl state resetup
this.tickModelService(100_000_000);
glFinish();
}
} while (VoxyClient.isFrexActive() && (this.nodeManager.hasWork() || this.renderGen.getTaskCount()!=0 || !this.modelService.areQueuesEmpty()));
TimingStatistics.H.start(); TimingStatistics.H.start();

View File

@@ -754,7 +754,7 @@ public class AsyncNodeManager {
} }
public boolean hasWork() { public boolean hasWork() {
return this.workCounter.get()!=0 && RESULT_HANDLE.get(this) != null; return this.workCounter.get()!=0 || RESULT_HANDLE.get(this) != null;
} }
public void worldEvent(WorldSection section, int flags) { public void worldEvent(WorldSection section, int flags) {