Add a profiler section for debug wireframe rendering

This commit is contained in:
James Seibel
2023-08-20 18:38:21 -05:00
parent 3b14bd655c
commit 786c445a91
2 changed files with 9 additions and 3 deletions
@@ -329,8 +329,6 @@ public class DebugRenderer
public void render(Mat4f transform)
{
if (!Config.Client.Advanced.Debugging.debugWireframeRendering.get()) return;
transform_this_frame = transform;
Vec3d cam = MC_RENDER.getCameraExactPosition();
camf = new Vec3f((float) cam.x, (float) cam.y, (float) cam.z);
@@ -301,7 +301,15 @@ public class LodRenderer
GL32.glBindBuffer(GL32.GL_ARRAY_BUFFER, 0);
this.shaderProgram.unbind();
DebugRenderer.INSTANCE.render(modelViewProjectionMatrix);
if (Config.Client.Advanced.Debugging.debugWireframeRendering.get())
{
profiler.popPush("Debug wireframes");
// Note: this can be very slow if a lot of boxes are being rendered
DebugRenderer.INSTANCE.render(modelViewProjectionMatrix);
profiler.popPush("LOD cleanup");
}
GL32.glClear(GL32.GL_DEPTH_BUFFER_BIT);
minecraftGlState.restore();