diff --git a/renderdoc/driver/gl/egl_hooks.cpp b/renderdoc/driver/gl/egl_hooks.cpp index 71c3870c3..8803c18d7 100644 --- a/renderdoc/driver/gl/egl_hooks.cpp +++ b/renderdoc/driver/gl/egl_hooks.cpp @@ -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 diff --git a/renderdoc/driver/gl/gl_dispatch_table.h b/renderdoc/driver/gl/gl_dispatch_table.h index aa13bb8a1..f5b06647d 100644 --- a/renderdoc/driver/gl/gl_dispatch_table.h +++ b/renderdoc/driver/gl/gl_dispatch_table.h @@ -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); \ No newline at end of file diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index 224266b44..d9d0f904c 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -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, ' '); diff --git a/renderdoc/driver/gl/gl_hooks.cpp b/renderdoc/driver/gl/gl_hooks.cpp index aa6e0ffa7..9248507f0 100644 --- a/renderdoc/driver/gl/gl_hooks.cpp +++ b/renderdoc/driver/gl/gl_hooks.cpp @@ -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) \ diff --git a/renderdoc/driver/gl/glx_hooks.cpp b/renderdoc/driver/gl/glx_hooks.cpp index 2de55b724..548743c4b 100644 --- a/renderdoc/driver/gl/glx_hooks.cpp +++ b/renderdoc/driver/gl/glx_hooks.cpp @@ -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 diff --git a/renderdoc/driver/gl/wgl_hooks.cpp b/renderdoc/driver/gl/wgl_hooks.cpp index ca5671f87..6cc8810cd 100644 --- a/renderdoc/driver/gl/wgl_hooks.cpp +++ b/renderdoc/driver/gl/wgl_hooks.cpp @@ -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"))