Set nextDrawable TLS data before creating hook

This commit is contained in:
Jake Turner
2022-05-14 09:20:05 +01:00
committed by Baldur Karlsson
parent 259205fdc9
commit 8d7d060e63
+3 -1
View File
@@ -72,10 +72,12 @@ void WrappedMTLDevice::MTLHookObjcMethods()
if(s_hookObjcMethods)
return;
nextDrawableTLSSlot = Threading::AllocateTLSSlot();
Threading::SetTLSValue(WrappedMTLDevice::nextDrawableTLSSlot, (void *)(uintptr_t) false);
Method m =
class_getInstanceMethod(objc_lookUpClass("CAMetalLayer"), sel_registerName("nextDrawable"));
real_CAMetalLayer_nextDrawable = method_setImplementation(m, (IMP)hooked_CAMetalLayer_nextDrawable);
nextDrawableTLSSlot = Threading::AllocateTLSSlot();
}
void WrappedMTLDevice::MTLFixupForMetalDriverAssert()