mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-09 09:10:49 +00:00
Don't allow aliases to overwrite core function pointers
* This is a bit of a hack. Mesa seems to return a function pointer for functions it recognises but doesn't support. So e.g. if you query for glBindFramebuffer you'll get the implementation, if you query for glBindFramebufferEXT then you get a stub that errors out. * So in this case we ensure that any EXT/ARB aliases only set their function pointer if we don't have the core function already. This will fix some cases but obviously doesn't help if the core function is the error-stub and the extension is supported...
This commit is contained in:
@@ -75,7 +75,8 @@ void *libGLdlsymHandle =
|
||||
#define HookExtensionAlias(funcPtrType, function, alias) \
|
||||
if(!strcmp(func, STRINGIZE(alias))) \
|
||||
{ \
|
||||
OpenGLHook::glhooks.GL.function = (funcPtrType)realFunc; \
|
||||
if(OpenGLHook::glhooks.GL.function == NULL) \
|
||||
OpenGLHook::glhooks.GL.function = (funcPtrType)realFunc; \
|
||||
return (__GLXextFuncPtr)&CONCAT(function, _renderdoc_hooked); \
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ void EmulateUnsupportedFunctions(GLHookSet *hooks);
|
||||
#define HookExtensionAlias(funcPtrType, function, alias) \
|
||||
if(!strcmp(func, STRINGIZE(alias))) \
|
||||
{ \
|
||||
glhooks.GL.function = (funcPtrType)realFunc; \
|
||||
if(OpenGLHook::glhooks.GL.function == NULL) \
|
||||
glhooks.GL.function = (funcPtrType)realFunc; \
|
||||
return (PROC)&glhooks.CONCAT(function, _hooked); \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user