From 0563cde3c2df9b22b180448ad100f2acb1cde581 Mon Sep 17 00:00:00 2001 From: tom lee Date: Mon, 27 Dec 2021 23:42:47 +0800 Subject: [PATCH] GLProxy: Add temp debug enable via setting debugMode to SHOW_DETAIL` --- src/main/java/com/seibel/lod/core/render/GLProxy.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/seibel/lod/core/render/GLProxy.java b/src/main/java/com/seibel/lod/core/render/GLProxy.java index 16c1df1a0..2dc2b396d 100644 --- a/src/main/java/com/seibel/lod/core/render/GLProxy.java +++ b/src/main/java/com/seibel/lod/core/render/GLProxy.java @@ -34,6 +34,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.seibel.lod.core.ModInfo; import com.seibel.lod.core.api.ClientApi; import com.seibel.lod.core.enums.config.GpuUploadMethod; +import com.seibel.lod.core.enums.rendering.DebugMode; import com.seibel.lod.core.enums.rendering.GLProxyContext; import com.seibel.lod.core.util.SingletonHandler; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton; @@ -157,6 +158,9 @@ public class GLProxy */ private GLProxy() { + + boolean enableDebugLogging = CONFIG.client().advanced().debugging().getDebugMode() == DebugMode.SHOW_DETAIL; + // this must be created on minecraft's render context to work correctly ClientApi.LOGGER.info("Creating " + GLProxy.class.getSimpleName() + "... If this is the last message you see in the log there must have been a OpenGL error."); @@ -225,7 +229,8 @@ public class GLProxy setGlContext(GLProxyContext.LOD_BUILDER); // TODO: Enable this but disable INFO logging - //GLUtil.setupDebugMessageCallback(); + if (enableDebugLogging) + GLUtil.setupDebugMessageCallback(); // get specific capabilities // Check if we can use the Buffer Storage, which is available in GL4.4 or after @@ -252,8 +257,8 @@ public class GLProxy ClientApi.LOGGER.info("GPU Vendor [" + vendor + "], Preferred upload method is [" + preferredUploadMethod + "]."); setGlContext(GLProxyContext.PROXY_WORKER); - // TODO: Enable this but disable INFO logging - //GLUtil.setupDebugMessageCallback(); + if (enableDebugLogging) + GLUtil.setupDebugMessageCallback(); //==========// // clean up //