From 4ad4e2c29ca16a29d19a5b8c15892c1cb9e0cd46 Mon Sep 17 00:00:00 2001 From: tom lee Date: Mon, 27 Dec 2021 16:09:20 +0800 Subject: [PATCH] BufferUpload: Coresponding to core commit Changed configs. Also added some more exception logging in ExperWorldGen. And added a flag to JVM Minecraft to force JVM to always capture Stack Traces. --- .../src/main/java/com/seibel/lod/common/Config.java | 2 +- .../wrappers/config/LodConfigWrapperSingleton.java | 8 ++++---- .../worldGeneration/WorldGenerationStep.java | 13 ++++++------- .../src/main/resources/assets/lod/lang/en_us.json | 4 ++-- core | 2 +- fabric/build.gradle | 1 + 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/src/main/java/com/seibel/lod/common/Config.java b/common/src/main/java/com/seibel/lod/common/Config.java index 3eba8046e..d508232f8 100644 --- a/common/src/main/java/com/seibel/lod/common/Config.java +++ b/common/src/main/java/com/seibel/lod/common/Config.java @@ -224,7 +224,7 @@ public class Config extends ConfigGui @Category("client.advanced.buffers") @Entry(minValue = 0, maxValue = 5000) - public static int gpuUploadTimeoutInMilleseconds = IBuffers.GPU_UPLOAD_TIMEOUT_IN_MILLISECONDS_DEFAULT.defaultValue; + public static int gpuUploadPerMegabyteInMilliseconds = IBuffers.GPU_UPLOAD_PER_MEGABYTE_IN_MILLISECONDS_DEFAULT.defaultValue; @Category("client.advanced.buffers") @Entry diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java b/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java index 202407928..51428d5be 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java @@ -451,13 +451,13 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton @Override - public int getGpuUploadTimeoutInMilliseconds() + public int getGpuUploadPerMegabyteInMilliseconds() { - return Config.Client.Advanced.Buffers.gpuUploadTimeoutInMilleseconds; + return Config.Client.Advanced.Buffers.gpuUploadPerMegabyteInMilliseconds; } @Override - public void setGpuUploadTimeoutInMilliseconds(int newTimeoutInMilliseconds) { - Config.Client.Advanced.Buffers.gpuUploadTimeoutInMilleseconds = newTimeoutInMilliseconds; + public void setGpuUploadPerMegabyteInMilliseconds(int newMilliseconds) { + Config.Client.Advanced.Buffers.gpuUploadPerMegabyteInMilliseconds = newMilliseconds; } diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java index 4ef88e771..aa9c33461 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/worldGeneration/WorldGenerationStep.java @@ -404,8 +404,12 @@ public final class WorldGenerationStep { if (event.isCompleted()) { try { event.join(); - } catch (RuntimeException e) { - // Ignore. + } catch (Throwable e) { + e.printStackTrace(); + while (e.getCause() != null) { + e = e.getCause(); + e.printStackTrace(); + } } finally { iter.remove(); } @@ -426,7 +430,6 @@ public final class WorldGenerationStep { } public final void generateLodFromList(GenerationEvent event) { - try { // System.out.println("Started event: "+event); event.pEvent.beginNano = System.nanoTime(); GridList referencedChunks; @@ -481,10 +484,6 @@ public final class WorldGenerationStep { event.tParam.perf.recordEvent(event.pEvent); ClientApi.LOGGER.info(event.tParam.perf); } - } catch (RuntimeException e) { - e.printStackTrace(); - throw e; - } } public final GridList generateDirect(GenerationEvent e, int range, Steps step) { diff --git a/common/src/main/resources/assets/lod/lang/en_us.json b/common/src/main/resources/assets/lod/lang/en_us.json index a5a88a6c4..801736470 100644 --- a/common/src/main/resources/assets/lod/lang/en_us.json +++ b/common/src/main/resources/assets/lod/lang/en_us.json @@ -53,8 +53,8 @@ "DistantHorizons.config.client.advanced.buffers": "Buffers", "DistantHorizons.config.client.advanced.buffers.gpuUploadMethod": "GPU upload method", "DistantHorizons.config.client.advanced.buffers.gpuUploadMethod.@tooltip": "What method should be used to upload geometry to the GPU?", - "DistantHorizons.config.client.advanced.buffers.gpuUploadTimeoutInMilleseconds": "GPU upload timeout (milliseconds)", - "DistantHorizons.config.client.advanced.buffers.gpuUploadTimeoutInMilleseconds.@tooltip": "How long should we wait before uploading a buffer to the GPU? \nHelpful resource for frame times: https://fpstoms.com", + "DistantHorizons.config.client.advanced.buffers.gpuUploadPerMegabyteInMilliseconds": "GPU upload speed (milliseconds)", + "DistantHorizons.config.client.advanced.buffers.gpuUploadPerMegabyteInMilliseconds.@tooltip": "How long should a buffer wait per Megabyte of data uploaded? \nHelpful resource for frame times: https://fpstoms.com", "DistantHorizons.config.client.advanced.buffers.rebuildTimes": "Rebuild times", "DistantHorizons.config.client.advanced.buffers.rebuildTimes.@tooltip": "Rebuild times", "DistantHorizons.config.client.advanced.debugging": "Debug", diff --git a/core b/core index 2f6ff1a3e..5fe192f4c 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 2f6ff1a3ea9aece6a1828d794d94956360e73c08 +Subproject commit 5fe192f4c57a67c4718af752469cff571284e3f2 diff --git a/fabric/build.gradle b/fabric/build.gradle index a02fe37bb..1cac1e445 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -70,6 +70,7 @@ task copyCommonResources(type: Copy) { runClient { dependsOn(copyCoreResources) dependsOn(copyCommonResources) + jvmArgs "-XX:-OmitStackTraceInFastThrow" finalizedBy(deleteResources) }