OSMesa Gallium frontend disregards (obliterates) user supplied buffer contents.
If applicable
- Wine/Proton version: (current git master of 6.12)
Describe the issue
Civilization 3 (https://bugs.winehq.org/show_bug.cgi?id=41930) uses WGL on a 16-bit colorspace (5-6-5 BGR) to leverage OpenGL drawing into the device-independent-bitmap context which is used for the 2d graphics within the game.
The current WINE implementation of WGL for the WINE dibdrv uses OSMesa to accomplish the GL drawing.
The OSMesa gallium implementation does not copy the user-buffer into the color-buffer during OSMakeCurrent
, resulting in the user-buffer being 'emptied' when the GL rasterization is flushed to the user-buffer.
There is even a comment in the gallium frontend regarding this.
In the screenshot below there should be 2d terrain surrounding the settler unit in the center of the screen. Rather, the terrain is being set to black since the GL context draws last.