Requesting code-review of vanilla/forge code (1.7.10.1492)

keybounce

New Member
Jul 29, 2019
1,925
0
0
Alright, I think I need a code review of Vanilla code.

Minecraft.java, line 1008, runGameLoop:

Starts section root, then goes through the sections
tick, preRenderErrors, sound, render

Then, inside render, it starts display

Then, on line 1061, it ends the section, which goes back to render.

Next is this section:

Code:
  if (!this.skipRenderWorld)
  {
  FMLCommonHandler.instance().onRenderTickStart(this.timer.renderPartialTicks);
  this.mcProfiler.endStartSection("gameRenderer");
  this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks);
  this.mcProfiler.endSection();
  FMLCommonHandler.instance().onRenderTickEnd(this.timer.renderPartialTicks);
  }

  GL11.glFlush();
  this.mcProfiler.endSection();

If I'm reading this right, then as soon as it goes into this section, it has one more profiler endSection() call than there is a corresponding startSection().

This is where I'm crashing vanilla code from my code. My code is no-where to be seen in the stacktrace, but I seem to be triggering this.

So:
1. Am I reading this as a vanilla/forge bug correctly, and
2. WTH did I do to trigger this control flow?
 

keybounce

New Member
Jul 29, 2019
1,925
0
0
HeldPlayer pointed out on Xcw's forum that the start and stop profiling sections do match and balance out as long as that middle section is not skipped. So, while this does explain the extra ".root."'s that I saw in my debugging runs, it doesn't explain why I am getting crashes on the endSection right after that glFlush call.