mojira.dev
MC-311345

Reloading resource packs with the OpenGL rendering backend when in a world causes visual glitches and crashes

Reloading resource packs multiple times while in a world and using the OpenGL graphics API (both when set to “Default” and directly to “Prefer OpenGL”) will, after enough reloads, cause some strange graphical corruption, followed by the game crashing with the following error:

[Render thread/ERROR]: Reported exception thrown!
net.minecraft.ReportedException: Render Frame
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1280)
	at net.minecraft.client.Minecraft.run(Minecraft.java:967)
	at net.minecraft.client.main.Main.main(Main.java:292)
Caused by: java.lang.IllegalStateException: Failed to complete GPU fence: 0
	at com.mojang.renderpearl.backend.opengl.GlCommandEncoder.awaitSubmit(GlCommandEncoder.java:116)
	at com.mojang.renderpearl.backend.opengl.GlCommandEncoder.submit(GlCommandEncoder.java:86)
	at com.mojang.renderpearl.frontend.FrontendCommandEncoder.submit(FrontendCommandEncoder.java:49)
	at net.minecraft.client.Minecraft.renderFrame(Minecraft.java:1399)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1274)
	... 2 more

I have attached the crash log to this report.

Note however, the visual corruption may not happen to everyone, and the crash may not always be the same as reported here; see the comments for more information.

In my case, sometimes, but not always, the visual corruption starts with some chunks getting unrendered, eventually getting to the point where the entire world gets unrendered. Continuing to reload can result in texture corruption, and eventually the game crashing.

None of this seems to occur when reloading resource packs on the Title Screen, nor when using the Vulkan graphics API.

This did not happen in 26.2 and earlier from what I have observed.

Steps to reproduce:

  1. Launch the game with the OpenGL graphics API.

  2. Open a world.

  3. Start reloading resource packs, easily done using the debug combination F3 + T.

  4. Keep reloading resource packs. From my testing it takes around 17-20 reloads for the corruption to start in a normal world; in a Superflat world without structures it seems to take quite a lot more.

  5. Observe the behavior that ensues.

Expected result:

Reloading resource packs would work normally as before.

Actual result:

Reloading resource packs multiple times using the OpenGL graphics API causes the graphics to severely corrupt and the game to ultimately crash.

Attachments

Comments 3

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media][media][media]

I got a different crash when attempting to reproduce this after 15 reloads. I saw no visual glitches though.

[media]

I got another different crash when trying this in a flat world with a few entities and blocks. Still no visual glitches. Very odd.

[media]

minecraft120

RogueLogix

Plausible

Platform G

Normal

Resource Packs

26.3 Snapshot 9, 26.3 Snapshot 10

26.3 Pre-Release 2

Retrieved