[PATCH 0/1] MR6513: opengl32: Add WGL_DOUBLE_BUFFER_ARB to the explicit sort list.
The Legend of Pirates Online expects the formats without WGL_DOUBLE_BUFFER_ARB to be listed first in wglChoosePixelFormatARB() (otherwise it goes into a special wglBindTexImageARB() path which causes blank rendering on both winex11 and winewayland) which was the old winex11 behavior that this change now matches. Fixes: 272c55ac257 ("opengl32: Add default implementation for wglChoosePixelFormatARB.") -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6513
From: Aida Jonikienė <aidas957(a)gmail.com> The Legend of Pirates Online expects the formats without WGL_DOUBLE_BUFFER_ARB to be listed first in wglChoosePixelFormatARB() (otherwise it goes into a special wglBindTexImageARB() path which causes blank rendering on both winex11 and winewayland) which was the old winex11 behavior that this change now matches. Fixes: 272c55ac257 ("opengl32: Add default implementation for wglChoosePixelFormatARB.") --- dlls/opengl32/wgl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index c6414054ff5..5b176291e70 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -754,6 +754,7 @@ BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *attribs_int, const FLOA ctx.attribs[2 * i + 1] ); /* Some attributes we always want to sort by (values don't matter for sorting) */ + compare_formats_ctx_set_attrib( &ctx, WGL_DOUBLE_BUFFER_ARB, 0 ); compare_formats_ctx_set_attrib( &ctx, WGL_ACCELERATION_ARB, 0 ); compare_formats_ctx_set_attrib( &ctx, WGL_COLOR_BITS_ARB, 0 ); compare_formats_ctx_set_attrib( &ctx, WGL_ACCUM_BITS_ARB, 0 ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6513
This isn't what native AMD drivers seem to be doing, see https://testbot.winehq.org/JobDetails.pl?Key=148500&f101=exe64.report&f102=e.... It would be interesting to write tests doing exactly the same wglChoosePixelFormatARB query as the game and see what is supposed to be returned. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6513#note_82610
On Thu Sep 19 13:11:52 2024 +0000, Rémi Bernon wrote:
This isn't what native AMD drivers seem to be doing, see https://testbot.winehq.org/JobDetails.pl?Key=148500&f101=exe64.report&f102=e.... It would be interesting to write tests doing exactly the same wglChoosePixelFormatARB query as the game and see what is supposed to be returned. The game calls `wglChoosePixelFormatARB()` with a non-NULL HDC, an integer attribute list of `{WGL_SUPPORT_OPENGL_ARB, TRUE, WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, 0}`, an empty float attribute list and max format count of 1024 according to apitrace
I'll try to add tests for this a bit later -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6513#note_82650
On Thu Sep 19 14:54:22 2024 +0000, Aida Jonikienė wrote:
The game initially calls `wglChoosePixelFormatARB()` with a non-NULL HDC, an integer attribute list of `{WGL_SUPPORT_OPENGL_ARB, TRUE, WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, 0}`, an empty float attribute list and max format count of 1024 according to apitrace (in later calls it uses integer attributes of `{WGL_SUPPORT_OPENGL_ARB, TRUE, WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, WGL_DRAW_TO_PBUFFER_ARB, TRUE, WGL_BIND_TO_TEXTURE_RGB_ARB, TRUE, 0}`) I see the game is picking a double-buffered pixel format without my MR and a non-double-buffered one with it applied too I'll try to add tests for this a bit later I realized some time ago that this game is using `wglBind/ReleaseTexImageARB()` in the double-buffered pixel format path (which seem to be semi-broken functions on both winex11 and winewayland)
I guess I should turn this MR into a potential fix for those function implementations then (which is more likely to be merged than this workaround) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6513#note_85343
participants (2)
-
Aida Jonikienė -
Rémi Bernon