[PATCH 0/1] MR10914: win32u: Allow OpenGL context / HDC pixel format mismatch.
This may happen if HDC is from a Pbuffer, and context was created separately. Let's not be restrictive if host GL allows it. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59555 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10914
From: Rémi Bernon <rbernon@codeweavers.com> This may happen if HDC is from a Pbuffer, and context was created separately. Let's not be restrictive if host GL allows it. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59555 --- dlls/win32u/opengl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index 3b8db3ca291..3d03b41fc24 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -1930,12 +1930,6 @@ static BOOL win32u_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC c else RtlSetLastWin32Error( ERROR_INVALID_HANDLE ); return FALSE; } - if (context->format != format) - { - WARN( "Mismatched draw_hdc %p format %u, context %p format %u\n", draw_hdc, format, context, context->format ); - RtlSetLastWin32Error( ERROR_INVALID_PIXEL_FORMAT ); - return FALSE; - } created = create_memory_pbuffer( draw_hdc ); if (!context_sync_drawables( context, draw_hdc, read_hdc )) return FALSE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10914
Apparently we have tests for this behavior but I think it's acceptable to still allow this. As Paul investigated modern windows don't allow the broken codepath as the framebuffer effects game option that triggers it is simply disabled there, while we somehow report something that makes it available. We were allowing this before and the game option was working fine, we have a choice of either figuring how to make the option be unavailable, which would arguably be regressive as well but would match modern windows behavior, or to allow mismatching pixel formats like this does. I think the latter is better and harmless. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10914#note_140061
Yeah, I'd agree that while not matching current Windows restoring this older Wine behaviour might be a good way to fix it. I don't have hardware to check that unfortunately but I suspect that back then it allowed format mismatch at least for pbuffers on Windows. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10914#note_140066
v2: Add todo_wine to now failing tests. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10914#note_140307
participants (3)
-
Paul Gofman (@gofman) -
Rémi Bernon -
Rémi Bernon (@rbernon)