From 258ccf89e01f0b8bb02069dab6fb6e720d4fda1b Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Tue, 1 Jul 2025 10:33:47 +1000 Subject: [PATCH] move init --- src/main/java/me/cortex/voxy/client/VoxyClient.java | 8 +++++++- .../java/me/cortex/voxy/client/core/VoxyRenderSystem.java | 4 ---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/cortex/voxy/client/VoxyClient.java b/src/main/java/me/cortex/voxy/client/VoxyClient.java index a0ea47e9..c2ad1803 100644 --- a/src/main/java/me/cortex/voxy/client/VoxyClient.java +++ b/src/main/java/me/cortex/voxy/client/VoxyClient.java @@ -2,6 +2,7 @@ package me.cortex.voxy.client; import me.cortex.voxy.client.core.gl.Capabilities; import me.cortex.voxy.client.core.model.bakery.BudgetBufferRenderer; +import me.cortex.voxy.client.core.rendering.util.SharedIndexBuffer; import me.cortex.voxy.common.Logger; import me.cortex.voxy.commonImpl.VoxyCommon; import net.fabricmc.api.ClientModInitializer; @@ -19,13 +20,18 @@ public class VoxyClient implements ClientModInitializer { @Override public void onInitializeClient() { ClientLifecycleEvents.CLIENT_STARTED.register(client->{ + Capabilities.init();//Ensure clinit is called + boolean systemSupported = Capabilities.INSTANCE.compute && Capabilities.INSTANCE.indirectParameters; if (systemSupported) { + + SharedIndexBuffer.INSTANCE.id(); + BudgetBufferRenderer.init(); + VoxyCommon.setInstanceFactory(VoxyClientInstance::new); } else { Logger.error("Voxy is unsupported on your system."); } - BudgetBufferRenderer.init(); }); diff --git a/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java b/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java index a1e6134d..3dc19bdc 100644 --- a/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java +++ b/src/main/java/me/cortex/voxy/client/core/VoxyRenderSystem.java @@ -54,10 +54,6 @@ public class VoxyRenderSystem { glFinish(); glFinish(); - //Trigger the shared index buffer loading - SharedIndexBuffer.INSTANCE.id(); - Capabilities.init();//Ensure clinit is called - this.worldIn = world; this.renderer = new RenderService(world, threadPool); this.postProcessing = new PostProcessing();