Fix crash on macos
This commit is contained in:
@@ -133,7 +133,7 @@ dependencies {
|
|||||||
|
|
||||||
//modImplementation('io.github.douira:glsl-transformer:2.0.1')
|
//modImplementation('io.github.douira:glsl-transformer:2.0.1')
|
||||||
|
|
||||||
modCompileOnly("maven.modrinth:vivecraft:1.21.1-1.1.14-b2-fabric")
|
modCompileOnly("maven.modrinth:vivecraft:1.21.8-1.2.5-b6-fabric")
|
||||||
|
|
||||||
modCompileOnly("maven.modrinth:flashback:rNCr1Rbs")
|
modCompileOnly("maven.modrinth:flashback:rNCr1Rbs")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class VoxyConfig implements OptionStorage<VoxyConfig> {
|
|||||||
public boolean enableRendering = true;
|
public boolean enableRendering = true;
|
||||||
public boolean ingestEnabled = true;
|
public boolean ingestEnabled = true;
|
||||||
public int sectionRenderDistance = 16;
|
public int sectionRenderDistance = 16;
|
||||||
public int serviceThreads = (int) Math.max(CpuLayout.CORES.length/1.5, 1);
|
public int serviceThreads = (int) Math.max(CpuLayout.getCoreCount()/1.5, 1);
|
||||||
public float subDivisionSize = 64;
|
public float subDivisionSize = 64;
|
||||||
public boolean renderVanillaFog = false;
|
public boolean renderVanillaFog = false;
|
||||||
public boolean useEnvironmentalFog = false;
|
public boolean useEnvironmentalFog = false;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class ServiceThreadPool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ServiceThreadPool(int threadCount, int priority) {
|
public ServiceThreadPool(int threadCount, int priority) {
|
||||||
if (CpuLayout.CORES.length-2 < threadCount) {
|
if (CpuLayout.getCoreCount()-2 < threadCount) {
|
||||||
Logger.warn("The thread count over core count -2, performance degradation possible");
|
Logger.warn("The thread count over core count -2, performance degradation possible");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ public class ServiceThreadPool {
|
|||||||
for (int i = 0; i < threadCount; i++) {
|
for (int i = 0; i < threadCount; i++) {
|
||||||
int threadId = i;
|
int threadId = i;
|
||||||
var worker = new Thread(this.threadGroup, ()->{
|
var worker = new Thread(this.threadGroup, ()->{
|
||||||
if (CpuLayout.CORES.length>3) {
|
if (CpuLayout.CORES!=null && CpuLayout.CORES.length>3) {
|
||||||
//Set worker affinity if possible
|
//Set worker affinity if possible
|
||||||
CpuLayout.setThreadAffinity(CpuLayout.CORES[2 + (threadId % (CpuLayout.CORES.length - 2))]);
|
CpuLayout.setThreadAffinity(CpuLayout.CORES[2 + (threadId % (CpuLayout.CORES.length - 2))]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,4 +156,12 @@ public class CpuLayout {
|
|||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getCoreCount() {
|
||||||
|
if (CORES==null) {
|
||||||
|
return Runtime.getRuntime().availableProcessors();
|
||||||
|
} else {
|
||||||
|
return CORES.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user