mojira.dev

P K

Assigned

No issues.

Reported

View all
MC-309939 Major framerate regression since 26.2 on some systems (OpenGL) Won't Fix

Comments

I'm not an OpenGL/rendering expert, so please correct me if I'm misreading any of this - but I compared the decompiled source (official mappings) between Pre-release 1 and Snapshot 8 and think I found something relevant.

com.mojang.blaze3d.opengl.GlCommandEncoder#submit() appears to create a GL fence sync object every frame, unconditionally, starting in Pre-release 1:

this.fences[this.currentSubmitSlot()] = GL33C.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
this.currentSubmitIndex++;
[...]

In Snapshot 8, submit() seemed to only do:

this.transientMemory.rotate();

To test this theory, I wrote a small Fabric mixin that redirects just the GL33C.glFenceSync(int, int) call inside submit() to a no-op returning 0L, leaving the rest of the method untouched:

@Redirect(
    method = "submit",
    at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL33C;glFenceSync(II)J"),
    remap = false
)
private long glFenceSyncNull(int a, int b) {
    return 0L;
}

With just that change, I get ~600 FPS again on my system, matching Snapshot 8 - and it seems to work the same way on the 26.2 Release jar, not just Pre-release 1. I also tried removing only the wait afterward (awaitSubmit) while keeping the glFenceSync() call, which made no difference - so as far as I can tell, it's specifically the glFenceSync() call that's costly here, not the waiting logic around it, though I can't really explain why from a driver/OpenGL perspective.

This may also relate to the profiler behavior noted in the original report — Snapshot 8 shows similar performance when the profiler is enabled — but that part is speculative.

I'm not confident this is the full picture, just sharing in case it helps narrow things down.

Interesting. Yes, the framerate regression also occurs in more difficult scenarios. The flat world test is just for easier demonstration.

I’ve also tested it with your world and uploaded the results to this google drive folder.

You’ll notice that the difference is about 100 FPS in my case (~100 on pre-1 vs. ~200 on snapshot-8).