timing + other
This commit is contained in:
@@ -73,6 +73,7 @@ public class TimingStatistics {
|
|||||||
public static TimeSampler all = new TimeSampler();
|
public static TimeSampler all = new TimeSampler();
|
||||||
public static TimeSampler main = new TimeSampler();
|
public static TimeSampler main = new TimeSampler();
|
||||||
public static TimeSampler dynamic = new TimeSampler();
|
public static TimeSampler dynamic = new TimeSampler();
|
||||||
|
public static TimeSampler postDynamic = new TimeSampler();
|
||||||
|
|
||||||
|
|
||||||
public static void update() {
|
public static void update() {
|
||||||
|
|||||||
@@ -200,6 +200,8 @@ public class VoxyRenderSystem {
|
|||||||
|
|
||||||
|
|
||||||
this.postProcessing.renderPost(projection, matrices.projection(), boundFB);
|
this.postProcessing.renderPost(projection, matrices.projection(), boundFB);
|
||||||
|
TimingStatistics.main.stop();
|
||||||
|
TimingStatistics.postDynamic.start();
|
||||||
|
|
||||||
PrintfDebugUtil.tick();
|
PrintfDebugUtil.tick();
|
||||||
|
|
||||||
@@ -211,11 +213,11 @@ public class VoxyRenderSystem {
|
|||||||
this.renderDistanceTracker.setCenterAndProcess(cameraX, cameraZ);
|
this.renderDistanceTracker.setCenterAndProcess(cameraX, cameraZ);
|
||||||
|
|
||||||
//Done here as is allows less gl state resetup
|
//Done here as is allows less gl state resetup
|
||||||
this.renderer.tickModelService(5_000_000-(System.nanoTime()-startTime));
|
this.renderer.tickModelService(Math.max(5_000_000-(System.nanoTime()-startTime), 75_000));
|
||||||
}
|
}
|
||||||
|
TimingStatistics.postDynamic.stop();
|
||||||
|
|
||||||
glBindFramebuffer(GlConst.GL_FRAMEBUFFER, oldFB);
|
glBindFramebuffer(GlConst.GL_FRAMEBUFFER, oldFB);
|
||||||
TimingStatistics.main.stop();
|
|
||||||
TimingStatistics.all.stop();
|
TimingStatistics.all.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +226,7 @@ public class VoxyRenderSystem {
|
|||||||
this.renderer.addDebugData(debug);
|
this.renderer.addDebugData(debug);
|
||||||
{
|
{
|
||||||
TimingStatistics.update();
|
TimingStatistics.update();
|
||||||
debug.add("Voxy frame runtime (millis): " + TimingStatistics.dynamic.pVal() + ", " + TimingStatistics.main.pVal()+ ", " + TimingStatistics.all.pVal());
|
debug.add("Voxy frame runtime (millis): " + TimingStatistics.dynamic.pVal() + ", " + TimingStatistics.main.pVal()+ ", " + TimingStatistics.postDynamic.pVal()+ ", " + TimingStatistics.all.pVal());
|
||||||
}
|
}
|
||||||
PrintfDebugUtil.addToOut(debug);
|
PrintfDebugUtil.addToOut(debug);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,17 +70,16 @@ public class ModelBakerySubsystem {
|
|||||||
VarHandle.fullFence();
|
VarHandle.fullFence();
|
||||||
{
|
{
|
||||||
long budget = Math.min(totalBudget-150_000, totalBudget-(this.factory.resultJobs.size()*10_000L))-150_000;
|
long budget = Math.min(totalBudget-150_000, totalBudget-(this.factory.resultJobs.size()*10_000L))-150_000;
|
||||||
if (budget > 50_000) {
|
|
||||||
|
//Always do 1 iteration minimum
|
||||||
Integer i = this.blockIdQueue.poll();
|
Integer i = this.blockIdQueue.poll();
|
||||||
if (i != null) {
|
if (i != null) {
|
||||||
do {
|
do {
|
||||||
this.factory.addEntry(i);
|
this.factory.addEntry(i);
|
||||||
|
if (budget<(System.nanoTime() - start)+1000)
|
||||||
|
break;
|
||||||
i = this.blockIdQueue.poll();
|
i = this.blockIdQueue.poll();
|
||||||
} while (i != null && (System.nanoTime() - start < budget));
|
} while (i != null);
|
||||||
if (i != null) {//We timedout on our budget and we have an entry so we must add it back
|
|
||||||
this.blockIdQueue.add(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public class RenderService<T extends AbstractSectionRenderer<J, ?>, J extends Vi
|
|||||||
|
|
||||||
//if (this.modelService.getProcessingCount() < 750)
|
//if (this.modelService.getProcessingCount() < 750)
|
||||||
{//Very bad hack to try control things
|
{//Very bad hack to try control things
|
||||||
this.geometryUpdateQueue.consumeNano(2_000_000 - (System.nanoTime() - frameStart));
|
this.geometryUpdateQueue.consumeNano(3_000_000 - (System.nanoTime() - frameStart));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nodeCleaner.tick(this.traversal.getNodeBuffer());//Probably do this here??
|
this.nodeCleaner.tick(this.traversal.getNodeBuffer());//Probably do this here??
|
||||||
|
|||||||
@@ -371,9 +371,16 @@ public class RenderDataFactory45 {
|
|||||||
int iA = idx * 2 + (facingForward == 1 ? 0 : shift);
|
int iA = idx * 2 + (facingForward == 1 ? 0 : shift);
|
||||||
int iB = idx * 2 + (facingForward == 1 ? shift : 0);
|
int iB = idx * 2 + (facingForward == 1 ? shift : 0);
|
||||||
|
|
||||||
|
//Check if next culls this face
|
||||||
|
if (false) {
|
||||||
|
if (ModelQueries.faceOccludes(this.sectionData[iB + 1], (axis << 1) | (1 - facingForward))) {
|
||||||
|
this.blockMesher.skip(1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
long selfModel = this.sectionData[iA];
|
long selfModel = this.sectionData[iA];
|
||||||
long nextModel = this.sectionData[iB];
|
long nextModel = this.sectionData[iB];
|
||||||
|
|
||||||
this.blockMesher.putNext(((long) facingForward) |//Facing
|
this.blockMesher.putNext(((long) facingForward) |//Facing
|
||||||
selfModel |
|
selfModel |
|
||||||
(nextModel & (0xFFL << 55))//Apply lighting
|
(nextModel & (0xFFL << 55))//Apply lighting
|
||||||
@@ -783,8 +790,19 @@ public class RenderDataFactory45 {
|
|||||||
long B = this.sectionData[(idx + 1) * 2];
|
long B = this.sectionData[(idx + 1) * 2];
|
||||||
|
|
||||||
//Flip data with respect to facing direction
|
//Flip data with respect to facing direction
|
||||||
long selfModel = facingForward==1?A:B;
|
int iA = idx * 2 + (facingForward == 1 ? 0 : 2);
|
||||||
long nextModel = facingForward==1?B:A;
|
int iB = idx * 2 + (facingForward == 1 ? 2 : 0);
|
||||||
|
|
||||||
|
//Check if next culls this face
|
||||||
|
if (false) {
|
||||||
|
if (ModelQueries.faceOccludes(this.sectionData[iB + 1], (2 << 1) | (1 - facingForward))) {
|
||||||
|
mesher.skip(1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long selfModel = this.sectionData[iA];
|
||||||
|
long nextModel = this.sectionData[iB];
|
||||||
|
|
||||||
//Example thing thats just wrong but as example
|
//Example thing thats just wrong but as example
|
||||||
mesher.putNext(((long) facingForward) |//Facing
|
mesher.putNext(((long) facingForward) |//Facing
|
||||||
|
|||||||
@@ -51,8 +51,7 @@ public class SaveLoadSystem3 {
|
|||||||
long metadataPtr = ptr; ptr += 8;
|
long metadataPtr = ptr; ptr += 8;
|
||||||
|
|
||||||
long blockPtr = ptr; ptr += WorldSection.SECTION_VOLUME*2;
|
long blockPtr = ptr; ptr += WorldSection.SECTION_VOLUME*2;
|
||||||
for (int i = 0; i < WorldSection.SECTION_VOLUME; i++) {
|
for (long block : data) {
|
||||||
long block = data[i];
|
|
||||||
short mapping = LUT.putIfAbsent(block, (short) LUT.size());
|
short mapping = LUT.putIfAbsent(block, (short) LUT.size());
|
||||||
if (mapping == -1) {
|
if (mapping == -1) {
|
||||||
mapping = (short) (LUT.size()-1);
|
mapping = (short) (LUT.size()-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user