diff --git a/src/main/java/me/cortex/voxy/client/config/VoxyConfig.java b/src/main/java/me/cortex/voxy/client/config/VoxyConfig.java index afba1821..7e9efad2 100644 --- a/src/main/java/me/cortex/voxy/client/config/VoxyConfig.java +++ b/src/main/java/me/cortex/voxy/client/config/VoxyConfig.java @@ -4,6 +4,7 @@ import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import me.cortex.voxy.common.Logger; +import me.cortex.voxy.common.util.cpu.CpuLayout; import me.cortex.voxy.commonImpl.VoxyCommon; import net.caffeinemc.mods.sodium.client.gui.options.storage.OptionStorage; import net.fabricmc.loader.api.FabricLoader; @@ -27,7 +28,7 @@ public class VoxyConfig implements OptionStorage { public boolean enableRendering = true; public boolean ingestEnabled = true; public int sectionRenderDistance = 16; - public int serviceThreads = Math.max(Runtime.getRuntime().availableProcessors()/2, 1); + public int serviceThreads = Math.max(CpuLayout.CORES.length/2, 1); public float subDivisionSize = 64; public boolean renderVanillaFog = false; public boolean renderStatistics = false; diff --git a/src/main/java/me/cortex/voxy/client/config/VoxyConfigScreenPages.java b/src/main/java/me/cortex/voxy/client/config/VoxyConfigScreenPages.java index 02bedd65..392a69c4 100644 --- a/src/main/java/me/cortex/voxy/client/config/VoxyConfigScreenPages.java +++ b/src/main/java/me/cortex/voxy/client/config/VoxyConfigScreenPages.java @@ -7,6 +7,7 @@ import me.cortex.voxy.client.RenderStatistics; import me.cortex.voxy.client.VoxyClientInstance; import me.cortex.voxy.client.core.IGetVoxyRenderSystem; import me.cortex.voxy.common.Logger; +import me.cortex.voxy.common.util.cpu.CpuLayout; import me.cortex.voxy.commonImpl.IVoxyWorld; import me.cortex.voxy.commonImpl.VoxyCommon; import net.caffeinemc.mods.sodium.client.gui.SodiumOptionsGUI; @@ -60,7 +61,10 @@ public abstract class VoxyConfigScreenPages { ).add(OptionImpl.createBuilder(int.class, storage) .setName(Text.translatable("voxy.config.general.serviceThreads")) .setTooltip(Text.translatable("voxy.config.general.serviceThreads.tooltip")) - .setControl(opt->new SliderControl(opt, 1, Runtime.getRuntime().availableProcessors(), 1, v->Text.literal(Integer.toString(v)))) + .setControl(opt->new SliderControl(opt, 1, + CpuLayout.CORES.length, //Just do core size as max + //Runtime.getRuntime().availableProcessors(),//Note: this is threads not cores, the default value is half the core count, is fine as this should technically be the limit but CpuLayout.CORES.length is more realistic + 1, v->Text.literal(Integer.toString(v)))) .setBinding((s, v)->{ boolean wasEnabled = VoxyCommon.getInstance() != null; var vrsh = (IGetVoxyRenderSystem) MinecraftClient.getInstance().worldRenderer; diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java b/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java index a6058c61..c5002ff4 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/RenderService.java @@ -53,6 +53,7 @@ public class RenderService, J extends Vi geometryCapacity = Math.min(geometryCapacity, limit); } //geometryCapacity = 1<<24; + //geometryCapacity = 1<<30;//1GB test return geometryCapacity; } diff --git a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java index c2aeca2a..3b29d966 100644 --- a/src/main/java/me/cortex/voxy/common/world/WorldEngine.java +++ b/src/main/java/me/cortex/voxy/common/world/WorldEngine.java @@ -74,6 +74,8 @@ public class WorldEngine { return this.sectionTracker.acquire(pos, true); } + public static final int POS_FORMAT_VERSION = 1; + //TODO: Fixme/optimize, cause as the lvl gets higher, the size of x,y,z gets smaller so i can dynamically compact the format // depending on the lvl, which should optimize colisions and whatnot public static long getWorldSectionId(int lvl, int x, int y, int z) {