Merge remote-tracking branch 'origin/main'
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ public class DhApiMultiThreadingConfig implements IDhApiMultiThreadingConfig
|
||||
|
||||
@Override
|
||||
public IDhApiConfigValue<Integer> dataConverterThreads()
|
||||
{ return new DhApiConfigValue<Integer, Integer>(Config.Client.Advanced.MultiThreading.numberOfDataConverterThreads); }
|
||||
{ return new DhApiConfigValue<Integer, Integer>(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads); }
|
||||
|
||||
@Override
|
||||
public IDhApiConfigValue<Integer> chunkLodConverterThreads()
|
||||
|
||||
@@ -802,7 +802,7 @@ public class Config
|
||||
.comment(THREAD_RUN_TIME_RATIO_NOTE)
|
||||
.build();
|
||||
|
||||
public static final ConfigEntry<Integer> numberOfDataConverterThreads = new ConfigEntry.Builder<Integer>()
|
||||
public static final ConfigEntry<Integer> numberOfDataTransformerThreads = new ConfigEntry.Builder<Integer>()
|
||||
.setMinDefaultMax(1,
|
||||
ThreadPresetConfigEventHandler.getDataConverterDefaultThreadCount(),
|
||||
Runtime.getRuntime().availableProcessors())
|
||||
@@ -818,7 +818,7 @@ public class Config
|
||||
+ "\n"
|
||||
+ THREAD_NOTE)
|
||||
.build();
|
||||
public static final ConfigEntry<Double> runTimeRatioForDataConverterThreads = new ConfigEntry.Builder<Double>()
|
||||
public static final ConfigEntry<Double> runTimeRatioForDataTransformerThreads = new ConfigEntry.Builder<Double>()
|
||||
.setMinDefaultMax(0.01, ThreadPresetConfigEventHandler.getDataConverterDefaultRunTimeRatio(), 1.0)
|
||||
.comment(THREAD_RUN_TIME_RATIO_NOTE)
|
||||
.build();
|
||||
|
||||
+4
-4
@@ -88,7 +88,7 @@ public class ThreadPresetConfigEventHandler extends AbstractPresetConfigEventHan
|
||||
|
||||
|
||||
public static int getDataConverterDefaultThreadCount() { return getThreadCountByPercent(0.1); }
|
||||
private final ConfigEntryWithPresetOptions<EThreadPreset, Integer> dataConverterThreadCount = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.MultiThreading.numberOfDataConverterThreads,
|
||||
private final ConfigEntryWithPresetOptions<EThreadPreset, Integer> dataTransformerThreadCount = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads,
|
||||
new HashMap<EThreadPreset, Integer>()
|
||||
{{
|
||||
this.put(EThreadPreset.MINIMAL_IMPACT, 1);
|
||||
@@ -98,7 +98,7 @@ public class ThreadPresetConfigEventHandler extends AbstractPresetConfigEventHan
|
||||
this.put(EThreadPreset.I_PAID_FOR_THE_WHOLE_CPU, getThreadCountByPercent(1.0));
|
||||
}});
|
||||
public static double getDataConverterDefaultRunTimeRatio() { return 0.25; }
|
||||
private final ConfigEntryWithPresetOptions<EThreadPreset, Double> dataConverterRunTime = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.MultiThreading.runTimeRatioForDataConverterThreads,
|
||||
private final ConfigEntryWithPresetOptions<EThreadPreset, Double> dataTransformerRunTime = new ConfigEntryWithPresetOptions<>(Config.Client.Advanced.MultiThreading.runTimeRatioForDataTransformerThreads,
|
||||
new HashMap<EThreadPreset, Double>()
|
||||
{{
|
||||
this.put(EThreadPreset.MINIMAL_IMPACT, 0.1);
|
||||
@@ -149,8 +149,8 @@ public class ThreadPresetConfigEventHandler extends AbstractPresetConfigEventHan
|
||||
this.configList.add(this.fileHandlerThreadCount);
|
||||
this.configList.add(this.fileHandlerRunTime);
|
||||
|
||||
this.configList.add(this.dataConverterThreadCount);
|
||||
this.configList.add(this.dataConverterRunTime);
|
||||
this.configList.add(this.dataTransformerThreadCount);
|
||||
this.configList.add(this.dataTransformerRunTime);
|
||||
|
||||
this.configList.add(this.chunkLodConverterThreadCount);
|
||||
this.configList.add(this.chunkLodConverterRunTime);
|
||||
|
||||
+4
-3
@@ -77,14 +77,15 @@ public class DataRenderTransformer
|
||||
// static setup
|
||||
if (configListener == null)
|
||||
{
|
||||
configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfDataConverterThreads, (threadCount) -> { setThreadPoolSize(threadCount); });
|
||||
configListener = new ConfigChangeListener<>(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads, (threadCount) -> { setThreadPoolSize(threadCount); });
|
||||
}
|
||||
|
||||
|
||||
// TODO this didn't seem to be re-sizing when changed via the config
|
||||
if (transformerThreadPool == null || transformerThreadPool.isTerminated())
|
||||
{
|
||||
LOGGER.info("Starting "+DataRenderTransformer.class.getSimpleName());
|
||||
setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfDataConverterThreads.get());
|
||||
setThreadPoolSize(Config.Client.Advanced.MultiThreading.numberOfDataTransformerThreads.get());
|
||||
}
|
||||
}
|
||||
public static void setThreadPoolSize(int threadPoolSize)
|
||||
@@ -95,7 +96,7 @@ public class DataRenderTransformer
|
||||
transformerThreadPool.shutdown();
|
||||
}
|
||||
|
||||
transformerThreadPool = ThreadUtil.makeRateLimitedThreadPool(threadPoolSize, "Full/Render Data Transformer", Config.Client.Advanced.MultiThreading.runTimeRatioForDataConverterThreads);
|
||||
transformerThreadPool = ThreadUtil.makeRateLimitedThreadPool(threadPoolSize, "Full/Render Data Transformer", Config.Client.Advanced.MultiThreading.runTimeRatioForDataTransformerThreads);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -323,12 +323,12 @@
|
||||
"distanthorizons.config.client.advanced.multiThreading.runTimeRatioForFileHandlerThreads":
|
||||
"Runtime % for file handler threads",
|
||||
|
||||
"distanthorizons.config.client.advanced.multiThreading.numberOfDataConverterThreads":
|
||||
"NO. of data converter threads",
|
||||
"distanthorizons.config.client.advanced.multiThreading.numberOfDataConverterThreads.@tooltip":
|
||||
"distanthorizons.config.client.advanced.multiThreading.numberOfDataTransformerThreads":
|
||||
"NO. of data transformer threads",
|
||||
"distanthorizons.config.client.advanced.multiThreading.numberOfDataTransformerThreads.@tooltip":
|
||||
"The number of threads used when converting ID data to render-able data. \n(This generally happens when generating new terrain or changing graphics settings). \nCan only be between 1 and your CPU's processor count.",
|
||||
"distanthorizons.config.client.advanced.multiThreading.runTimeRatioForDataConverterThreads":
|
||||
"Runtime % for data converter threads",
|
||||
"distanthorizons.config.client.advanced.multiThreading.runTimeRatioForDataTransformerThreads":
|
||||
"Runtime % for data transformer threads",
|
||||
|
||||
"distanthorizons.config.client.advanced.multiThreading.numberOfChunkLodConverterThreads":
|
||||
"NO. of chunk LOD converter threads",
|
||||
@@ -363,7 +363,11 @@
|
||||
"distanthorizons.config.client.advanced.debugging.debugWireframeRendering":
|
||||
"Enable Debug Wireframe Rendering",
|
||||
"distanthorizons.config.client.advanced.debugging.debugWireframeRendering.@tooltip":
|
||||
"If enabled, various wireframes for debugging internal functions will be drawn.",
|
||||
"If enabled, various wireframes for debugging internal functions will be drawn.",
|
||||
"distanthorizons.config.client.advanced.debugging.allowUnsafeValues":
|
||||
"Allow Unsafe UI Values",
|
||||
"distanthorizons.config.client.advanced.debugging.allowUnsafeValues.@tooltip":
|
||||
"If enabled, very limited config input validation will be performed. \n\nWarning: enabling this can cause instability or crashing, use at your own risk. \nNote: this is option isn't saved between sessions.",
|
||||
|
||||
"distanthorizons.config.client.advanced.buffers":
|
||||
"Buffers",
|
||||
@@ -415,36 +419,36 @@
|
||||
|
||||
|
||||
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen":
|
||||
"Debug Config Screen",
|
||||
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.debugConfigScreenNote":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.debugConfigScreenNote":
|
||||
"This screen is to debug features of the config screen",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.boolTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.boolTest":
|
||||
"Boolean test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.byteTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.byteTest":
|
||||
"Byte test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.intTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.intTest":
|
||||
"Integer test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.doubleTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.doubleTest":
|
||||
"Double test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.shortTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.shortTest":
|
||||
"Short test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.longTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.longTest":
|
||||
"Long test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.floatTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.floatTest":
|
||||
"Float test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.stringTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.stringTest":
|
||||
"String test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.listTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.listTest":
|
||||
"List (ArrayList) test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.mapTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.mapTest":
|
||||
"Map (HashMap) test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.categoryTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.categoryTest":
|
||||
"Category test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.linkableTest":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.linkableTest":
|
||||
"Linkable test",
|
||||
"distanthorizons.config.client.advanced.debugging.debugConfigScreen.linkableTest.@tooltip":
|
||||
"distanthorizons.config.client.advanced.debugging.exampleConfigScreen.linkableTest.@tooltip":
|
||||
"The value of this should be the same as in Category Test",
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user