Incorrect main menu rendering in Minecraft (Java Edition) 1.12.2
System information
- OS: NAME=Gentoo
- GPU:
00:02.0 VGA compatible controller [0300]: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller [8086:0416] (rev 06)
07:00.0 3D controller [0302]: NVIDIA Corporation GK208M [GeForce GT 740M] [10de:1292] (rev a1)
- Kernel version:
Linux gen 5.5.6-gentoo #3 SMP PREEMPT Thu May 28 18:32:01 CEST 2020 x86_64 Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz GenuineIntel GNU/Linux
- Mesa version:
Separate mesa build used for zink, complete with intel vulkan driver:
OpenGL version string: 3.0 Mesa 21.2.0-devel (git-345290abe5)
System mesa (should be irrelevant):OpenGL version string: 3.0 Mesa 20.2.0-devel (git-6cba468b5e)
- Xserver version (if applicable):
X.Org X Server 1.20.8
- Desktop manager and compositor: xfce4
Describe the issue
In Minecraft Java Edition 1.12.2 main menu panorama view is not rendered. This works fine in version 1.16.5 and 1.17-rc1.
Regression
Worked on very old commit 10431c89 but all other GUI rendering was broken.
Extra information
I'm developing a few Minecraft mods and I'm familiar with it's code, Minecraft is doing something really strange with the panorama rendering, I don't really understand how or why it even works, but it works on all other drivers, including mesa software renderer. Reading the code, the sequence seems to be as follows:
unbind framebuffer (if framebuffer is supported and enabled, framebuffer being enabled in options seems to make no difference)
enable blending
disable alpha
disable cull face
depth mask false
blend func: SRC_ALPHA, ONE_MINUS_SRC_ALPHA, ONE, ZERO
repeat 64 times with different translations and 6 times for each texture
some glRotate and glTranslate calls
bind the right texture
some other state setup and glDrawArrays
depth mask -> true
enable cull face
repeat a few times:
enable blend
blend func: SRC_ALPHA, ONE_MINUS_SRC_ALPHA, ONE, ZERO
disable alpha
colorMask true, true, true, false
bind a special 256x256 texture that seems to be never written to, data set to null (!?)
draw it to cover the entire screen at different offsets and alpha values (again, glDrawArrays)
enableAlpha
colorMask true, true, true, true
re-bind framebuffer