From 4c687cb90788e2b2509a230c8a5183d00ad7521e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 15 Dec 2009 20:51:12 +0100 Subject: [PATCH 01/13] WineD3D: Add a direct-to-GL wine_glFinish This waits for GL to finish without updating the screen in child window GL. Thus it avoids message deadlocks if called from inside the GL lock. This will be used by my next patch. wine_glFlush can be added in the future, e.g. for D3DGETDATA_FLUSH in query::getData. In the future gl_compat.c could use this function and glFlush to emulate GL_APPLE_flush_render, but there is no formal specification yet, only a rough description. --- dlls/wined3d/directx.c | 2 ++ dlls/wined3d/wined3d_gl.h | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 0267443..0854693 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -4657,9 +4657,11 @@ BOOL InitAdapters(IWineD3DImpl *This) #ifdef USE_WIN32_OPENGL wglFinish = (void*)GetProcAddress(mod_gl, "glFinish"); wglFlush = (void*)GetProcAddress(mod_gl, "glFlush"); + wine_glFinish = (void*)GetProcAddress(mod_gl, "glFinish"); #else wglFinish = (void*)pwglGetProcAddress("wglFinish"); wglFlush = (void*)pwglGetProcAddress("wglFlush"); + wine_glFinish = (void*)pwglGetProcAddress("glFinish"); #endif glEnableWINE = glEnable; diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index d6d9794..3502da1 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -1169,6 +1169,9 @@ void (WINE_GLAPI *glPointParameterfv)(GLenum pname, const GLfloat *params) DECLS void (__stdcall *wglFinish)(void) DECLSPEC_HIDDEN; void (__stdcall *wglFlush)(void) DECLSPEC_HIDDEN; +/* Direct call to the GL lib. No GL_FRONT update, but no concerns about wgl deadlocks */ +void (WINE_GLAPI *wine_glFinish) (void) DECLSPEC_HIDDEN; + /* WGL functions */ HGLRC (WINAPI *pwglCreateContext)(HDC) DECLSPEC_HIDDEN; BOOL (WINAPI *pwglDeleteContext)(HGLRC) DECLSPEC_HIDDEN; -- 1.6.4.4