Provide GREMEDY GL extensions even if not supported by the driver

This commit is contained in:
baldurk
2019-02-05 10:42:37 +00:00
parent 2a80fd29d0
commit 99910959ee
6 changed files with 21 additions and 6 deletions
+3 -2
View File
@@ -421,8 +421,9 @@ eglGetProcAddress_renderdoc_hooked(const char *func)
realFunc = EGL.GetProcAddress(func);
}
// if the real context doesn't support this function, return NULL
if(realFunc == NULL)
// if the real context doesn't support this function, and we don't provide an implementation fully
// ourselves, return NULL
if(realFunc == NULL && !FullyImplementedFunction(func))
return realFunc;
// return our egl hooks
+2
View File
@@ -991,3 +991,5 @@ void EnableGLHooks();
// the real function, if it exists, or the real function if not. It's used in the platform-specific
// implementations of GetProcAddress to look up the shared list of hooks.
void *HookedGetProcAddress(const char *funcname, void *realFunc);
bool FullyImplementedFunction(const char *funcname);
+2
View File
@@ -1244,6 +1244,8 @@ void WrappedOpenGL::ActivateContext(GLWindowingData winData)
// this extension is something RenderDoc will support even if the impl
// doesn't. https://renderdoc.org/debug_tool.txt
ctxdata.glExts.push_back("GL_EXT_debug_tool");
ctxdata.glExts.push_back("GL_GREMEDY_frame_terminator");
ctxdata.glExts.push_back("GL_GREMEDY_string_marker");
merge(ctxdata.glExts, ctxdata.glExtsString, ' ');
+8
View File
@@ -129,6 +129,14 @@ void EnableGLHooks()
DefineSupportedHooks();
DefineUnsupportedHooks();
// these functions we provide ourselves, so we should return our hook even if there's no onward
// implementation.
bool FullyImplementedFunction(const char *funcname)
{
return !strcmp(funcname, "glFrameTerminatorGREMEDY") ||
!strcmp(funcname, "glStringMarkerGREMEDY");
}
void *HookedGetProcAddress(const char *func, void *realFunc)
{
#define CheckFunction(function, name) \
+3 -2
View File
@@ -507,8 +507,9 @@ HOOK_EXPORT __GLXextFuncPtr glXGetProcAddress_renderdoc_hooked(const GLubyte *f)
realFunc = GLX.glXGetProcAddress(f);
}
// if the real context doesn't support this function, return NULL
if(realFunc == NULL)
// if the real context doesn't support this function, and we don't provide an implementation fully
// ourselves, return NULL
if(realFunc == NULL && !FullyImplementedFunction(func))
return realFunc;
// return our glX hooks
+3 -2
View File
@@ -520,8 +520,9 @@ static PROC WINAPI wglGetProcAddress_hooked(const char *func)
realFunc = WGL.wglGetProcAddress(func);
}
// if the real context doesn't support this function, return NULL
if(realFunc == NULL)
// if the real context doesn't support this function, and we don't provide an implementation fully
// ourselves, return NULL
if(realFunc == NULL && !FullyImplementedFunction(func))
return realFunc;
if(!strcmp(func, "wglCreateContext"))