Enable GL hooks via EGL on windows, as well as via WGL

* Without this, injecting into a GLES application on windows might not work as
  the hooks won't be enabled when a context create is seen.
This commit is contained in:
baldurk
2018-11-14 10:55:35 +00:00
parent 5c5ab3def3
commit b4f7d74565
4 changed files with 6 additions and 3 deletions
+1
View File
@@ -193,6 +193,7 @@ HOOK_EXPORT EGLContext EGLAPIENTRY eglCreateContext_renderdoc_hooked(EGLDisplay
eglhook.configs[ret] = config;
EnableGLHooks();
eglhook.driver.SetDriverType(RDCDriver::OpenGLES);
{
SCOPED_LOCK(glLock);
+3 -1
View File
@@ -970,7 +970,9 @@ void SetDriverForHooks(WrappedOpenGL *driver);
// intialisation. This can have false positives if the program creates a context late, but it's the
// best we can do.
#if ENABLED(RDOC_WIN32)
void EnableHooks();
void EnableGLHooks();
#else
#define EnableGLHooks() (void)0
#endif
// this function looks up our list of hook entry points and returns our hook entry point instead of
+1 -1
View File
@@ -105,7 +105,7 @@ void SetDriverForHooks(WrappedOpenGL *driver)
}
#if ENABLED(RDOC_WIN32)
void EnableHooks()
void EnableGLHooks()
{
glhook.enabled = true;
}
+1 -1
View File
@@ -55,7 +55,7 @@ public:
void WGLHook::PopulateFromContext(HDC dc, HGLRC rc)
{
SetDriverForHooks(&driver);
EnableHooks();
EnableGLHooks();
// called from wglCreate*Context*, to populate GL functions as soon as possible by making a new
// context current and fetching our function pointers