mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Change Metal hooking to use RegisterFunctionHook
Instead of direct function pointer capture at compile time
This commit is contained in:
committed by
Baldur Karlsson
parent
91df933215
commit
6d24e2b100
@@ -81,9 +81,15 @@ void MetalHook::RegisterGlobalNonHookedMetalFunctions()
|
||||
#undef METAL_FETCH
|
||||
}
|
||||
|
||||
extern void AppleRegisterRealSymbol(const char *functionName, void *address);
|
||||
|
||||
void MetalHook::RegisterGlobalHookedMetalFunctions()
|
||||
{
|
||||
#define METAL_FUNC(func) METAL.func = &::func;
|
||||
#define METAL_FUNC(func) \
|
||||
AppleRegisterRealSymbol(STRINGIZE(func), (void *)&::func); \
|
||||
LibraryHooks::RegisterFunctionHook("Metal", FunctionHook(STRINGIZE(func), (void **)&METAL.func, \
|
||||
(void *)&METAL_EXPORT_NAME(func)));
|
||||
|
||||
ForEachMetalSupported();
|
||||
#undef METAL_FUNC
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user