mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Provide GREMEDY GL extensions even if not supported by the driver
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
@@ -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, ' ');
|
||||
|
||||
|
||||
@@ -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) \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user