From 225e2d9d1af43ad659ba661b34f8536036a61460 Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Sat, 7 Jun 2025 14:37:02 +1000 Subject: [PATCH] is ment to be * not + idiot --- .../rendering/hierachical/NodeCleaner.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/NodeCleaner.java b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/NodeCleaner.java index a08c7100..4698a4af 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/NodeCleaner.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/hierachical/NodeCleaner.java @@ -8,6 +8,7 @@ import me.cortex.voxy.client.core.gl.shader.ShaderType; import me.cortex.voxy.client.core.rendering.util.PrintfDebugUtil; import me.cortex.voxy.client.core.rendering.util.DownloadStream; import me.cortex.voxy.client.core.rendering.util.UploadStream; +import org.lwjgl.opengl.ARBDirectStateAccess; import org.lwjgl.system.MemoryUtil; import static org.lwjgl.opengl.ARBDirectStateAccess.glCopyNamedBufferSubData; @@ -112,7 +113,7 @@ public class NodeCleaner { //TODO: choose whether this is in nodeSpace or section/geometryId space // glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); - glDispatchCompute((this.nodeManager.getCurrentMaxNodeId() + (SORTING_WORKER_SIZE+WORK_PER_THREAD) - 1) / (SORTING_WORKER_SIZE+WORK_PER_THREAD), 1, 1); + glDispatchCompute((this.nodeManager.getCurrentMaxNodeId() + (SORTING_WORKER_SIZE*WORK_PER_THREAD) - 1) / (SORTING_WORKER_SIZE*WORK_PER_THREAD), 1, 1); this.resultTransformer.bind(); glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, this.outputBuffer.id, 0, 4 * OUTPUT_COUNT); @@ -165,6 +166,22 @@ public class NodeCleaner { } } + private void dumpDebugData() { + int[] outData = new int[OUTPUT_COUNT*3]; + ARBDirectStateAccess.glGetNamedBufferSubData(this.outputBuffer.id, 0, outData); + for(int i =0;i < OUTPUT_COUNT; i++) { + System.out.println(outData[i]); + } + /* + System.out.println("---------------\n"); + for(int i =0;i < OUTPUT_COUNT; i++) { + System.out.println(data[i*2+OUTPUT_COUNT]+", "+data[i*2+OUTPUT_COUNT+1]); + }*/ + int[] visData = new int[(int) (this.visibilityBuffer.size()/4)]; + ARBDirectStateAccess.glGetNamedBufferSubData(this.visibilityBuffer.id, 0, visData); + int a = 0; + } + public void free() { this.sorter.free(); this.visibilityBuffer.free();