Move global GL lock into common code

This commit is contained in:
baldurk
2018-07-06 22:44:18 +01:00
parent a7509dadb6
commit f849952ce9
7 changed files with 6 additions and 26 deletions
+2
View File
@@ -28,6 +28,8 @@
#include "strings/string_utils.h"
#include "gl_driver.h"
Threading::CriticalSection glLock;
GLChunk gl_CurChunk = GLChunk::Max;
bool HasExt[GLExtension_Count] = {};
+2
View File
@@ -267,6 +267,8 @@ const GLenum eGL_ONE = (GLenum)1;
class WrappedOpenGL;
struct GLHookSet;
extern Threading::CriticalSection glLock;
// replay only class for handling marker regions
struct GLMarkerRegion
{
+2 -5
View File
@@ -822,9 +822,6 @@ WrappedOpenGL::ContextData &WrappedOpenGL::GetCtxData()
return m_ContextData[GetCtx().ctx];
}
// defined in gl_<platform>_hooks.cpp
Threading::CriticalSection &GetGLLock();
////////////////////////////////////////////////////////////////
// Windowing/setup/etc
////////////////////////////////////////////////////////////////
@@ -1720,7 +1717,7 @@ void WrappedOpenGL::StartFrameCapture(void *dev, void *wnd)
if(!IsBackgroundCapturing(m_State))
return;
SCOPED_LOCK(GetGLLock());
SCOPED_LOCK(glLock);
m_State = CaptureState::ActiveCapturing;
@@ -1767,7 +1764,7 @@ bool WrappedOpenGL::EndFrameCapture(void *dev, void *wnd)
if(!IsActiveCapturing(m_State))
return true;
SCOPED_LOCK(GetGLLock());
SCOPED_LOCK(glLock);
CaptureFailReason reason = CaptureSucceeded;
-7
View File
@@ -33,8 +33,6 @@
#include "driver/gl/gl_hookset_defs.h"
Threading::CriticalSection glLock;
class OpenGLHook : LibraryHook
{
public:
@@ -83,8 +81,3 @@ const GLHookSet &GetRealGLFunctions()
RDCUNIMPLEMENTED("GetRealGLFunctions");
return dummyHookset;
}
Threading::CriticalSection &GetGLLock()
{
return glLock;
}
@@ -34,15 +34,9 @@
GLHookSet GL;
WrappedOpenGL *m_GLDriver;
Threading::CriticalSection glLock;
void *libGLdlsymHandle =
RTLD_NEXT; // default to RTLD_NEXT, but overwritten if app calls dlopen() on real libGL
Threading::CriticalSection &GetGLLock()
{
return glLock;
}
#define HookInit(function) \
if(!strcmp(func, STRINGIZE(function))) \
{ \
@@ -37,5 +37,4 @@ void PosixHookFunctions();
extern GLHookSet GL;
extern WrappedOpenGL *m_GLDriver;
extern Threading::CriticalSection glLock;
extern void *libGLdlsymHandle;
-7
View File
@@ -656,8 +656,6 @@
p14, p15, p16, p17); \
}
Threading::CriticalSection glLock;
typedef BOOL(WINAPI *WGLMAKECURRENTPROC)(HDC, HGLRC);
typedef BOOL(WINAPI *WGLDELETECONTEXTPROC)(HGLRC);
@@ -1913,11 +1911,6 @@ GLPlatform &GetGLPlatform()
return OpenGLHook::glhooks;
}
Threading::CriticalSection &GetGLLock()
{
return glLock;
}
// dirty immediate mode rendering functions for backwards compatible
// rendering of overlay text
typedef void(WINAPI *GLGETINTEGERVPROC)(GLenum, GLint *);