mojira.dev
MC-307404

DebugScreenOverlay.extractRenderState() calls nextStratum() unconditionally when currentlyEnabled is non-empty, even if no content is rendered

  DebugScreenOverlay.extractRenderState() calls graphics.nextStratum() based solely on whether getCurrentlyEnabled() is non-empty, without checking if any entry actually produced output. Empty strata corrupt the GUI render layer ordering, causing other
  GUI elements added via GuiGraphicsExtractor.text() to become invisible.

  The problematic code:

  Collection<Identifier> visibleEntries = this.minecraft.debugEntries.getCurrentlyEnabled();
  
if (!visibleEntries.isEmpty()) {
      graphics.nextStratum();   
// unconditional
      
// ... entries may produce zero output ...
      
this.extractLines(graphics, leftLines, 
true);
      
this.extractLines(graphics, rightLines, 
false);
      graphics.nextStratum();   
// unconditional again
  }

  This occurs in vanilla when debug-profile.json retains entry IDs from a previous version after migration. getCurrentlyEnabled() returns these IDs, but getEntry() returns null (entry no longer registered). The for-loop skips null entries, but
  nextStratum() already fired, creating empty strata that displace subsequent GUI rendering.

  Suggested fix  guard nextStratum() behind actual content:

  
if (!leftLines.isEmpty() || !rightLines.isEmpty()) {
      graphics.nextStratum();
      
this.extractLines(graphics, leftLines, 
true);
      
this.extractLines(graphics, rightLines, 
false);
      graphics.nextStratum();
  }
"Also affects 26.1, 26.1.1, 26.1.2-rc1"

Comments 0

No comments.

loong0x00

(Unassigned)

Unconfirmed

(Unassigned)

26.2-snapshot-1

Retrieved