https://bugs.winehq.org/show_bug.cgi?id=55021
Bug ID: 55021 Summary: The Evil Within shows a black screen with OpenGL renderer Product: Wine Version: 8.9 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@winehq.org Reporter: andrey.goosev@gmail.com CC: pgofman@codeweavers.com Distribution: ---
Before commit 446da60e78beb321d776b48cdee6f764c81b924b the game worked as a slide show. Now the performance feels normal, but it brings a black screen with sound. So it's just changing from one bad state to another.
https://bugs.winehq.org/show_bug.cgi?id=55021
--- Comment #1 from Andrey Gusev andrey.goosev@gmail.com --- This seems related 'err:d3d:wined3d_context_gl_set_pixel_format wglSetPixelFormatWINE failed to set pixel format 5 on device context 0000000013010098.'
https://bugs.winehq.org/show_bug.cgi?id=55021
--- Comment #2 from Paul Gofman pgofman@codeweavers.com --- I looked into this a bit. The game indeed uses SetPixelFormat() before creating swapchain for some reason, that's why directly setting pixel format fails (after the referenced commit). Backup context is successfully created, but then swapchain_blit_gdi() cannot blit it because the format the game uses for swapchain is WINED3DFMT_R8G8B8A8_UNORM and there is no D3DDDIFMT_ for this format which is allowed for memory GDI dc. Thus the black screen as the fallback GDI blit doesn't actually happen.
I don't immediately see a good and easy way out from here. The commit itself is not exactly regressive, the game is not functional anyway before it (here it is not even a slideshow but the whole desktop is blocked due to constant pixel format setting from wined3d which currently involves recreating child window).
The easiest is to create dc for D3DDDIFMT_A8R8G8B8 and convert byte order in memory, although I am not sure it is a good way to go.
Probably the better (but complicated) way is to do something better for internal pixel format management between wined3d and winex11.drv and do some blitting from offscreen window in winex11 (similar to how child window rendering is implemented). But it has certain complications on winex11 part, not quite sure if it worth it if Vulkan backend works.