opengl32: Don't use ENTER_GL/LEAVE_GL around calls to driver functions.
This causes lock inversions when the driver accesses the DC.
This commit is contained in:
parent
de154e738a
commit
6e01e4aa51
|
@ -569,9 +569,7 @@ BOOL WINAPI wglUseFontOutlinesW(HDC hdc,
|
||||||
void WINAPI wine_glEnable( GLenum cap )
|
void WINAPI wine_glEnable( GLenum cap )
|
||||||
{
|
{
|
||||||
TRACE("(%d)\n", cap );
|
TRACE("(%d)\n", cap );
|
||||||
ENTER_GL();
|
|
||||||
wine_wgl.p_wglEnable(cap);
|
wine_wgl.p_wglEnable(cap);
|
||||||
LEAVE_GL();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -579,12 +577,8 @@ void WINAPI wine_glEnable( GLenum cap )
|
||||||
*/
|
*/
|
||||||
GLboolean WINAPI wine_glIsEnabled( GLenum cap )
|
GLboolean WINAPI wine_glIsEnabled( GLenum cap )
|
||||||
{
|
{
|
||||||
GLboolean ret_value;
|
|
||||||
TRACE("(%d)\n", cap );
|
TRACE("(%d)\n", cap );
|
||||||
ENTER_GL();
|
return wine_wgl.p_wglIsEnabled(cap);
|
||||||
ret_value = wine_wgl.p_wglIsEnabled(cap);
|
|
||||||
LEAVE_GL();
|
|
||||||
return ret_value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -593,9 +587,7 @@ GLboolean WINAPI wine_glIsEnabled( GLenum cap )
|
||||||
void WINAPI wine_glDisable( GLenum cap )
|
void WINAPI wine_glDisable( GLenum cap )
|
||||||
{
|
{
|
||||||
TRACE("(%d)\n", cap );
|
TRACE("(%d)\n", cap );
|
||||||
ENTER_GL();
|
|
||||||
wine_wgl.p_wglDisable(cap);
|
wine_wgl.p_wglDisable(cap);
|
||||||
LEAVE_GL();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -604,9 +596,7 @@ void WINAPI wine_glDisable( GLenum cap )
|
||||||
void WINAPI wine_glScissor( GLint x, GLint y, GLsizei width, GLsizei height )
|
void WINAPI wine_glScissor( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||||
{
|
{
|
||||||
TRACE("(%d, %d, %d, %d)\n", x, y, width, height );
|
TRACE("(%d, %d, %d, %d)\n", x, y, width, height );
|
||||||
ENTER_GL();
|
|
||||||
wine_wgl.p_wglScissor(x, y, width, height);
|
wine_wgl.p_wglScissor(x, y, width, height);
|
||||||
LEAVE_GL();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -615,9 +605,7 @@ void WINAPI wine_glScissor( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||||
void WINAPI wine_glViewport( GLint x, GLint y, GLsizei width, GLsizei height )
|
void WINAPI wine_glViewport( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||||
{
|
{
|
||||||
TRACE("(%d, %d, %d, %d)\n", x, y, width, height );
|
TRACE("(%d, %d, %d, %d)\n", x, y, width, height );
|
||||||
ENTER_GL();
|
|
||||||
wine_wgl.p_wglViewport(x, y, width, height);
|
wine_wgl.p_wglViewport(x, y, width, height);
|
||||||
LEAVE_GL();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -678,11 +666,7 @@ const GLubyte * WINAPI wine_glGetString( GLenum name )
|
||||||
*/
|
*/
|
||||||
void WINAPI wine_glGetIntegerv( GLenum pname, GLint* params )
|
void WINAPI wine_glGetIntegerv( GLenum pname, GLint* params )
|
||||||
{
|
{
|
||||||
ENTER_GL();
|
|
||||||
glGetIntegerv(pname, params);
|
|
||||||
/* A few parameters like GL_DEPTH_BITS differ between WGL and GLX, the wglGetIntegerv helper function handles those */
|
|
||||||
wine_wgl.p_wglGetIntegerv(pname, params);
|
wine_wgl.p_wglGetIntegerv(pname, params);
|
||||||
LEAVE_GL();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1463,6 +1463,8 @@ static void sync_current_drawable(void)
|
||||||
width = ctx->physDev->dc_rect.right - ctx->physDev->dc_rect.left;
|
width = ctx->physDev->dc_rect.right - ctx->physDev->dc_rect.left;
|
||||||
height = ctx->physDev->dc_rect.bottom - ctx->physDev->dc_rect.top;
|
height = ctx->physDev->dc_rect.bottom - ctx->physDev->dc_rect.top;
|
||||||
|
|
||||||
|
wine_tsx11_lock();
|
||||||
|
|
||||||
pglViewport(ctx->physDev->dc_rect.left + ctx->viewport.left,
|
pglViewport(ctx->physDev->dc_rect.left + ctx->viewport.left,
|
||||||
dy + ctx->viewport.top,
|
dy + ctx->viewport.top,
|
||||||
ctx->viewport.right ? (ctx->viewport.right - ctx->viewport.left) : width,
|
ctx->viewport.right ? (ctx->viewport.right - ctx->viewport.left) : width,
|
||||||
|
@ -1478,6 +1480,7 @@ static void sync_current_drawable(void)
|
||||||
else
|
else
|
||||||
pglScissor(ctx->physDev->dc_rect.left, dy, width, height);
|
pglScissor(ctx->physDev->dc_rect.left, dy, width, height);
|
||||||
|
|
||||||
|
wine_tsx11_unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1796,7 +1799,9 @@ static void WINAPI X11DRV_wglDisable(GLenum cap)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
wine_tsx11_lock();
|
||||||
pglDisable(cap);
|
pglDisable(cap);
|
||||||
|
wine_tsx11_unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1809,17 +1814,24 @@ static void WINAPI X11DRV_wglEnable(GLenum cap)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
wine_tsx11_lock();
|
||||||
pglEnable(cap);
|
pglEnable(cap);
|
||||||
|
wine_tsx11_unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WGL helper function which handles differences in glGetIntegerv from WGL and GLX */
|
/* WGL helper function which handles differences in glGetIntegerv from WGL and GLX */
|
||||||
static void WINAPI X11DRV_wglGetIntegerv(GLenum pname, GLint* params) {
|
static void WINAPI X11DRV_wglGetIntegerv(GLenum pname, GLint* params)
|
||||||
TRACE("pname: 0x%x, params: %p\n", pname, params);
|
{
|
||||||
if (pname == GL_DEPTH_BITS) {
|
wine_tsx11_lock();
|
||||||
|
switch(pname)
|
||||||
|
{
|
||||||
|
case GL_DEPTH_BITS:
|
||||||
|
{
|
||||||
GLXContext gl_ctx = pglXGetCurrentContext();
|
GLXContext gl_ctx = pglXGetCurrentContext();
|
||||||
Wine_GLContext* ret = get_context_from_GLXContext(gl_ctx);
|
Wine_GLContext* ret = get_context_from_GLXContext(gl_ctx);
|
||||||
/*TRACE("returns Wine Ctx as %p\n", ret);*/
|
|
||||||
|
pglGetIntegerv(pname, params);
|
||||||
/**
|
/**
|
||||||
* if we cannot find a Wine Context
|
* if we cannot find a Wine Context
|
||||||
* we only have the default wine desktop context,
|
* we only have the default wine desktop context,
|
||||||
|
@ -1829,15 +1841,22 @@ static void WINAPI X11DRV_wglGetIntegerv(GLenum pname, GLint* params) {
|
||||||
*params = 32;
|
*params = 32;
|
||||||
}
|
}
|
||||||
TRACE("returns GL_DEPTH_BITS as '%d'\n", *params);
|
TRACE("returns GL_DEPTH_BITS as '%d'\n", *params);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (pname == GL_ALPHA_BITS) {
|
case GL_ALPHA_BITS:
|
||||||
GLint tmp;
|
{
|
||||||
GLXContext gl_ctx = pglXGetCurrentContext();
|
GLXContext gl_ctx = pglXGetCurrentContext();
|
||||||
Wine_GLContext* ret = get_context_from_GLXContext(gl_ctx);
|
Wine_GLContext* ret = get_context_from_GLXContext(gl_ctx);
|
||||||
pglXGetFBConfigAttrib(ret->display, ret->fb_conf, GLX_ALPHA_SIZE, &tmp);
|
|
||||||
TRACE("returns GL_ALPHA_BITS as '%d'\n", tmp);
|
pglXGetFBConfigAttrib(ret->display, ret->fb_conf, GLX_ALPHA_SIZE, params);
|
||||||
*params = tmp;
|
TRACE("returns GL_ALPHA_BITS as '%d'\n", *params);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
pglGetIntegerv(pname, params);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
wine_tsx11_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLboolean WINAPI X11DRV_wglIsEnabled(GLenum cap)
|
static GLboolean WINAPI X11DRV_wglIsEnabled(GLenum cap)
|
||||||
|
@ -1851,9 +1870,10 @@ static GLboolean WINAPI X11DRV_wglIsEnabled(GLenum cap)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
wine_tsx11_lock();
|
||||||
enabled = pglIsEnabled(cap);
|
enabled = pglIsEnabled(cap);
|
||||||
|
wine_tsx11_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue