gpu: use DebugGL4 in debug mode

This commit is contained in:
Adam
2022-03-19 18:05:53 -04:00
parent 7051bedc61
commit 508c5928fe
2 changed files with 18 additions and 2 deletions

View File

@@ -143,6 +143,12 @@
<artifactId>jogl-rl</artifactId>
<version>2.4.0-rc-20220318</version>
</dependency>
<dependency>
<groupId>net.runelite.jogl</groupId>
<artifactId>jogl-gldesktop-dbg</artifactId>
<version>2.4.0-rc-20220318</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.runelite.jogl</groupId>
<artifactId>jogl-rl</artifactId>

View File

@@ -30,6 +30,7 @@ import com.jogamp.nativewindow.AbstractGraphicsConfiguration;
import com.jogamp.nativewindow.NativeWindowFactory;
import com.jogamp.nativewindow.awt.AWTGraphicsConfiguration;
import com.jogamp.nativewindow.awt.JAWTWindow;
import com.jogamp.opengl.DebugGL4;
import com.jogamp.opengl.GL;
import static com.jogamp.opengl.GL.GL_ARRAY_BUFFER;
import static com.jogamp.opengl.GL.GL_DYNAMIC_DRAW;
@@ -418,10 +419,17 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
this.gl = glContext.getGL().getGL4();
setupSyncMode();
if (log.isDebugEnabled())
{
try
{
gl = new DebugGL4(gl);
}
catch (NoClassDefFoundError ex)
{
log.debug("Disabling DebugGL due to jogl-gldesktop-dbg not being present on the classpath");
}
gl.glEnable(gl.GL_DEBUG_OUTPUT);
// GLDebugEvent[ id 0x20071
@@ -441,6 +449,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
gl.GL_DONT_CARE, 1, new int[]{0x20052}, 0, false);
}
setupSyncMode();
initVao();
try
{