Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a config to enable debug output and object labels for OpenGL in erly display. #257

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

shartte
Copy link
Contributor

@shartte shartte commented Mar 2, 2025

Adds an FML option to:

  • Enable setting GL debug labels on objects created by early display
  • Add a debug group for updating the earlydisplay framebuffer
  • Enable the GL debug callback during early display (and make it synchronous) to enable debugging of early display

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Mar 2, 2025

  • Publish PR to GitHub Packages

Last commit published: 264bdc0445e381ada1c66c5cee0e6f3860d79a38.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #257' // https://github.com/neoforged/FancyModLoader/pull/257
        url 'https://prmaven.neoforged.net/FancyModLoader/pr257'
        content {
            includeModule('net.neoforged.fancymodloader', 'earlydisplay')
            includeModule('net.neoforged.fancymodloader', 'junit-fml')
            includeModule('net.neoforged.fancymodloader', 'loader')
            includeModule('net.neoforged.fancymodloader', 'tests')
        }
    }
}

@shartte shartte force-pushed the gldebug branch 2 times, most recently from fc3ef8c to 32102f0 Compare March 2, 2025 16:12
@shartte shartte marked this pull request as ready for review March 2, 2025 16:14
@neoforged-automation neoforged-automation bot added the needs rebase This Pull Request needs to be rebased before being merged label Mar 2, 2025
@neoforged-automation
Copy link

@shartte, this pull request has conflicts, please resolve them for this PR to move forward.

@neoforged-automation neoforged-automation bot removed the needs rebase This Pull Request needs to be rebased before being merged label Mar 2, 2025
maxLabelLength = 256;
}
if (capabilities.GL_EXT_debug_marker) {
groupMode = GroupMode.EXTENSION;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any case where GL_EXT_debug_marker might be true while GL_EXT_debug_label is false, causing maxLabelLength to not be set to a non-zero value?

@@ -390,6 +392,8 @@ public void draw() {
// but only once, the VAO saves this state
GlState.bindVertexArray(vao);
GlState.bindArrayBuffer(vbo);
GlDebug.labelVertexArray(vao, label);
GlDebug.labelBuffer(vao, label);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this label the VBO instead of the VAO?

@@ -41,6 +41,7 @@ public enum ConfigValue {
DEFAULT_CONFIG_PATH("defaultConfigPath", "defaultconfigs", "Default config path for servers"),
DISABLE_OPTIMIZED_DFU("disableOptimizedDFU", Boolean.TRUE, "Disables Optimized DFU client-side - already disabled on servers"),
EARLY_WINDOW_PROVIDER("earlyWindowProvider", "fmlearlywindow", "Early window provider"),
EARLY_WINDOW_GLDEBUG("earlyWindowGlDebug", Boolean.FALSE, "Enable OpenGL debugging in early window provider"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to make this setting more generic and wire it into RenderSystem.initRenderer() in NF (for sync debug output the config would be passed directly to initRenderer() and for debug labels the config would be ORed together with vanilla's renderDebugLabels command line option). That way GL debugging controlled by this setting would be consistent across the entire game instead of some parts being enabled in one place but not another and, specifically for sync debug output, would also allow this setting to impact the game even if the early window is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants