[radeonsi] Incorrect rendering when using glDisable(GL_MULTISAMPLE) with multisample backbuffer
System information
System: Host: marvin Kernel: 5.10.9-gentoo x86_64 bits: 64 compiler: N/A Desktop: KDE Plasma 5.21.3 tk: Qt 5.15.2
wm: kwin_x11 dm: SDDM Distro: Gentoo Base System release 2.7
CPU: Info: 32-Core (4-Die) model: AMD Ryzen Threadripper 3970X bits: 64 type: MT MCP MCM arch: Zen 2 L2 cache: 16.0 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 473629
Speed: 3597 MHz min/max: 2200/3700 MHz Core speeds (MHz): 1: 3595 2: 3601 3: 3603 4: 3594 5: 3597 6: 3595 7: 3590
8: 3601 9: 3602 10: 3590 11: 3591 12: 3591 13: 3601 14: 3605 15: 3599 16: 3595 17: 3599 18: 3599 19: 3602 20: 3602
21: 3595 22: 3596 23: 3595 24: 3604 25: 3599 26: 3600 27: 3595 28: 3600 29: 3615 30: 3602 31: 3598 32: 3599
33: 3604 34: 3597 35: 3590 36: 3599 37: 3600 38: 3646 39: 3604 40: 3597 41: 3591 42: 3597 43: 3599 44: 3566
45: 3482 46: 3597 47: 3310 48: 4070 49: 3592 50: 3585 51: 3596 52: 3606 53: 3601 54: 3596 55: 3589 56: 4504
57: 3597 58: 3589 59: 3599 60: 3588 61: 3592 62: 3596 63: 3600 64: 3601
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] driver: amdgpu v: kernel
bus ID: 23:00.0 chip ID: 1002:73bf
Display: x11 server: X.Org 1.20.10 compositor: kwin_x11 driver: amdgpu resolution: 3840x1600~144Hz s-dpi: 96
OpenGL: renderer: AMD Radeon RX 6900 XT (SIENNA_CICHLID DRM 3.40.0 5.10.9-gentoo LLVM 11.1.0)
v: 4.6 Mesa 21.1.0-devel (git-2d6b7b2e0c) direct render: Yes
Describe the issue
When using glDisable(GL_MULTISAMPLE) in a context with a multi-sample backbuffer some fragments seem to end up with incorrect coverage.
There seem to be two distinct issues:
- When mixing GL_MULTISAMPLE on/off the boundaries between some primitives (where coverage of each primitive is not 100%) have fragments with no coverage at all. This seems to apply to those primitives with GL_MULTISAMPLE enabled but GL_SAMPLE_ALPHA_TO_COVERAGE disabled.
- Even when GL_MULTISAMPLE is always disabled there is a diagonal line with fragments that are incorrectly have 0 coverage.
llvmpipe is even more incorrect - everything with GL_MULTISAMPLE disabled seems to only cover one sample - so this may not be entirely radeonsi-specific.
apitrace: https://constexpr.org/tmp/arx-msaa.trace.xz Make sure to pass --samples=8 to glretrace to show the issue (--samples=4 and --samples=2 also produce some interesting additional effects).
Regression
It used to work with my Vega 64 but I am unsure if it is a radeonsi regression or simply specific to the RX 6900 XT.
Screenshots/video files
Incorrect rendering (with GL_MULTISAMPLE disabled for background but enabled for the character):
Expected rendering (with GL_MULTISAMPLE always enabled):
Improved but still incorrect rendering (with GL_MULTISAMPLE always disabled):