From ec866fa1b85a294189e021fb29ed87dc5361dde7 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Wed, 7 May 2025 09:30:24 +1000 Subject: [PATCH] double max traversal size --- .../hierachical/HierarchicalOcclusionTraverser.java | 11 ++++++----- .../cortex/voxy/client/core/shader/ShaderSystem.java | 5 ----- 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 src/main/java/me/cortex/voxy/client/core/shader/ShaderSystem.java diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/HierarchicalOcclusionTraverser.java b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/HierarchicalOcclusionTraverser.java index 38cbdf82..9cba8611 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/HierarchicalOcclusionTraverser.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/HierarchicalOcclusionTraverser.java @@ -30,6 +30,7 @@ public class HierarchicalOcclusionTraverser { public static final boolean HIERARCHICAL_SHADER_DEBUG = System.getProperty("voxy.hierarchicalShaderDebug", "false").equals("true"); public static final int REQUEST_QUEUE_SIZE = 50; + public static final int MAX_QUEUE_SIZE = 200_000; private static final int MAX_ITERATIONS = WorldEngine.MAX_LOD_LAYER+1; @@ -42,17 +43,17 @@ public class HierarchicalOcclusionTraverser { private final GlBuffer nodeBuffer; private final GlBuffer uniformBuffer = new GlBuffer(1024).zero(); - private final GlBuffer renderList = new GlBuffer(100_000 * 4 + 4).zero();//100k sections max to render, TODO: Maybe move to render service or somewhere else + private final GlBuffer renderList = new GlBuffer(MAX_QUEUE_SIZE * 4 + 4).zero();//MAX_QUEUE_SIZE sections max to render, TODO: Maybe move to render service or somewhere else private final GlBuffer statisticsBuffer = new GlBuffer(1024).zero(); private int topNodeCount; private final Int2IntOpenHashMap topNode2idxMapping = new Int2IntOpenHashMap();//Used to store mapping from TLN to array index private final int[] idx2topNodeMapping = new int[100_000];//Used to map idx to TLN id - private final GlBuffer topNodeIds = new GlBuffer(100_000*4).zero(); + private final GlBuffer topNodeIds = new GlBuffer(MAX_QUEUE_SIZE*4).zero(); private final GlBuffer queueMetaBuffer = new GlBuffer(4*4*MAX_ITERATIONS).zero(); - private final GlBuffer scratchQueueA = new GlBuffer(100_000*4).zero(); - private final GlBuffer scratchQueueB = new GlBuffer(100_000*4).zero(); + private final GlBuffer scratchQueueA = new GlBuffer(MAX_QUEUE_SIZE*4).zero(); + private final GlBuffer scratchQueueB = new GlBuffer(MAX_QUEUE_SIZE*4).zero(); private static int BINDING_COUNTER = 1; private static final int SCENE_UNIFORM_BINDING = BINDING_COUNTER++; @@ -125,7 +126,7 @@ public class HierarchicalOcclusionTraverser { private void addTLN(int id) { int aid = this.topNodeCount++;//Increment buffer - if (this.topNodeCount > 100_000) { + if (this.topNodeCount > this.topNodeIds.size()/4) { throw new IllegalStateException("Top level node count greater than capacity"); } diff --git a/src/main/java/me/cortex/voxy/client/core/shader/ShaderSystem.java b/src/main/java/me/cortex/voxy/client/core/shader/ShaderSystem.java deleted file mode 100644 index 5bcd47be..00000000 --- a/src/main/java/me/cortex/voxy/client/core/shader/ShaderSystem.java +++ /dev/null @@ -1,5 +0,0 @@ -package me.cortex.voxy.client.core.shader; - -//Mutates the frag shaders of the material, like a deferred material shader system -public class ShaderSystem { -}