Skip to content

Commit

Permalink
Add a config to enable debug output and object labels for OpenGL in e…
Browse files Browse the repository at this point in the history
…arly display.
  • Loading branch information
shartte committed Mar 2, 2025
1 parent 0f835b6 commit adfd287
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package net.neoforged.fml.earlydisplay;

import static org.lwjgl.opengl.GL20C.glIsProgram;
import static org.lwjgl.opengl.GL32C.GL_ACTIVE_TEXTURE;
import static org.lwjgl.opengl.GL32C.GL_ARRAY_BUFFER;
import static org.lwjgl.opengl.GL32C.GL_ARRAY_BUFFER_BINDING;
Expand Down Expand Up @@ -396,7 +397,12 @@ public static void applySnapshot(StateSnapshot snapshot) {
clearColor(snapshot.clearColorRed, snapshot.clearColorGreen, snapshot.clearColorBlue, snapshot.clearColorAlpha);
enableBlend(snapshot.blendEnabled);
blendFuncSeparate(snapshot.blendSrcRGB, snapshot.blendDstRGB, snapshot.blendSrcAlpha, snapshot.blendDstAlpha);
useProgram(snapshot.currentProgram);
// The program might have been flagged for deletion and may no longer be available
if (glIsProgram(snapshot.currentProgram)) {
useProgram(snapshot.currentProgram);
} else {
useProgram(0);
}
activeTexture(snapshot.activeTextureUnit);
bindTexture2D(snapshot.boundTexture2D);
bindVertexArray(snapshot.boundVertexArray);
Expand Down

0 comments on commit adfd287

Please # to comment.