After wglMakeCurrent(NULL, NULL); wglSwapBuffers(HDC) actually swaps buffers for the device context. That works on Windows and basically with Wine glx (as glxSwapBuffers also works on drawable and doesn't need GLX context). But that doesn't work for child window rendering: first because of NULL ctx dereference (checked for NULL elsewhere) and next because of GLX_OML_sync_control path.
Fixes Black Desert Online launcher being black screen. The launcher does the following for drawing a frame (while drawing on the child window): ``` wglMakeCurrent(hdc, valid context); <gl drawing> wglMakeCurrent(NULL, NULL); wglSwapBuffers(hdc); ```
From: Paul Gofman pgofman@codeweavers.com
--- dlls/winex11.drv/opengl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index bb8f13f78b9..baeb6fe87fa 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3401,7 +3401,7 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) if (gl->type == DC_GL_CHILD_WIN) escape.gl_drawable = gl->window; /* fall through */ default: - if (escape.gl_drawable && pglXSwapBuffersMscOML) + if (ctx && (escape.drawable || gl->layered_type) && pglXSwapBuffersMscOML) { pglFlush(); target_sbc = pglXSwapBuffersMscOML( gdi_display, gl->drawable, 0, 0, 0 ); @@ -3411,13 +3411,13 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) break; }
- if (escape.gl_drawable && pglXWaitForSbcOML) + if (ctx && escape.gl_drawable && pglXWaitForSbcOML) pglXWaitForSbcOML( gdi_display, gl->drawable, target_sbc, &ust, &msc, &sbc );
release_gl_drawable( gl );
if (escape.gl_drawable) - NtGdiExtEscape( ctx->hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); + NtGdiExtEscape( ctx ? ctx->hdc : hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); return TRUE; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=142255
Your paranoid android.
=== debian11 (build log) ===
../wine/dlls/winex11.drv/opengl.c:3404:28: error: ���struct x11drv_escape_flush_gl_drawable��� has no member named ���drawable���; did you mean ���gl_drawable���? ../wine/dlls/winex11.drv/opengl.c:3404:42: error: ���struct gl_drawable��� has no member named ���layered_type��� Task: The win32 Wine build failed
=== debian11b (build log) ===
../wine/dlls/winex11.drv/opengl.c:3404:28: error: ���struct x11drv_escape_flush_gl_drawable��� has no member named ���drawable���; did you mean ���gl_drawable���? ../wine/dlls/winex11.drv/opengl.c:3404:42: error: ���struct gl_drawable��� has no member named ���layered_type��� Task: The wow64 Wine build failed