From 6bbd2c521aacec49135a23e435cf05420ae1953b Mon Sep 17 00:00:00 2001 From: mcrcortex <18544518+MCRcortex@users.noreply.github.com> Date: Tue, 3 Jun 2025 22:14:46 +1000 Subject: [PATCH] Use representitive fragment when possible --- .../java/me/cortex/voxy/client/core/gl/Capabilities.java | 4 +++- .../core/rendering/section/MDICSectionRenderer.java | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/cortex/voxy/client/core/gl/Capabilities.java b/src/main/java/me/cortex/voxy/client/core/gl/Capabilities.java index 92608dba..95e3b8a0 100644 --- a/src/main/java/me/cortex/voxy/client/core/gl/Capabilities.java +++ b/src/main/java/me/cortex/voxy/client/core/gl/Capabilities.java @@ -13,6 +13,7 @@ public class Capabilities { public static final Capabilities INSTANCE = new Capabilities(); + public final boolean repFragTest; public final boolean meshShaders; public final boolean INT64_t; public final long ssboMaxSize; @@ -28,7 +29,8 @@ public class Capabilities { var cap = GL.getCapabilities(); this.compute = cap.glDispatchComputeIndirect != 0; this.indirectParameters = cap.glMultiDrawElementsIndirectCountARB != 0; - this.meshShaders = cap.GL_NV_mesh_shader && cap.GL_NV_representative_fragment_test; + this.repFragTest = cap.GL_NV_representative_fragment_test; + this.meshShaders = cap.GL_NV_mesh_shader; this.canQueryGpuMemory = cap.GL_NVX_gpu_memory_info; //this.INT64_t = cap.GL_ARB_gpu_shader_int64 || cap.GL_AMD_gpu_shader_int64; //The only reliable way to test for int64 support is to try compile a shader diff --git a/src/main/java/me/cortex/voxy/client/core/rendering/section/MDICSectionRenderer.java b/src/main/java/me/cortex/voxy/client/core/rendering/section/MDICSectionRenderer.java index 1c1a6f7d..e1a68ed1 100644 --- a/src/main/java/me/cortex/voxy/client/core/rendering/section/MDICSectionRenderer.java +++ b/src/main/java/me/cortex/voxy/client/core/rendering/section/MDICSectionRenderer.java @@ -2,6 +2,7 @@ package me.cortex.voxy.client.core.rendering.section; import me.cortex.voxy.client.RenderStatistics; +import me.cortex.voxy.client.core.gl.Capabilities; import me.cortex.voxy.client.core.gl.GlBuffer; import me.cortex.voxy.client.core.gl.GlTexture; import me.cortex.voxy.client.core.gl.shader.Shader; @@ -34,6 +35,7 @@ import static org.lwjgl.opengl.GL42.glMemoryBarrier; import static org.lwjgl.opengl.GL43.*; import static org.lwjgl.opengl.GL45.glBindTextureUnit; import static org.lwjgl.opengl.GL45.glClearNamedBufferData; +import static org.lwjgl.opengl.NVRepresentativeFragmentTest.GL_REPRESENTATIVE_FRAGMENT_TEST_NV; //Uses MDIC to render the sections public class MDICSectionRenderer extends AbstractSectionRenderer { @@ -203,6 +205,9 @@ public class MDICSectionRenderer extends AbstractSectionRenderer