mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-10 06:11:36 +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:
1 parent
d2d8a978e4
commit
c5dbd7d6f0
2 files changed
+4
-2
No files matched your search
@@ -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