Add toggleable logging for GL Buffer garbage collection

Will need to be tested by someone who is experiencing issue #718, so far I've been unable to reproduce anything meaningful.
This commit is contained in:
James Seibel
2024-07-09 17:40:21 -05:00
parent 1f74f19cd9
commit 066b23c785
3 changed files with 19 additions and 2 deletions
@@ -1238,6 +1238,15 @@ public class Config
+ "")
.build();
public static ConfigEntry<Boolean> logBufferGarbageCollection = new ConfigEntry.Builder<Boolean>()
.set(false)
.comment(""
+ "If true OpenGL Buffer garbage collection will be logged \n"
+ "this also includes the number of live buffers. \n"
+ "")
.build();
// Note: This will reset on game restart, and should have a warning on the tooltip
public static ConfigEntry<Boolean> allowUnsafeValues = new ConfigEntry.Builder<Boolean>()
.set(false)
@@ -20,6 +20,7 @@
package com.seibel.distanthorizons.core.render.glObject.buffer;
import com.seibel.distanthorizons.api.enums.config.EDhApiGpuUploadMethod;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.render.glObject.GLProxy;
import com.seibel.distanthorizons.core.util.LodUtil;
@@ -140,7 +141,10 @@ public class GLBuffer implements AutoCloseable
GL32.glDeleteBuffers(id);
bufferCount.decrementAndGet();
//LOGGER.info("destroyed buffer ["+id+"], remaining: ["+BUFFER_ID_TO_PHANTOM.size()+"]");
if (Config.Client.Advanced.Debugging.logBufferGarbageCollection.get())
{
LOGGER.info("destroyed buffer [" + id + "], remaining: [" + BUFFER_ID_TO_PHANTOM.size() + "]");
}
}
});
}
@@ -474,7 +474,11 @@
"distanthorizons.config.client.advanced.debugging.showOverlappingQuadErrors":
"Show overlapping quad errors",
"distanthorizons.config.client.advanced.debugging.showOverlappingQuadErrors.@tooltip":
"f true overlapping quads will be rendered as bright red for easy identification. \nIf false the quads will be rendered normally.",
"If true overlapping quads will be rendered as bright red for easy identification. \nIf false the quads will be rendered normally.",
"distanthorizons.config.client.advanced.debugging.logBufferGarbageCollection":
"Log Buffer Garbage Collection",
"distanthorizons.config.client.advanced.debugging.logBufferGarbageCollection.@tooltip":
"If true OpenGL Buffer garbage collection will be logged \nthis also includes the number of live buffers. ",
"distanthorizons.config.client.advanced.debugging.allowUnsafeValues":
"Allow Unsafe UI Values",
"distanthorizons.config.client.advanced.debugging.allowUnsafeValues.@tooltip":