This repository has been archived by the owner on Aug 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metaliskil.m
34 lines (29 loc) · 1.17 KB
/
metaliskil.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// clang -fmodules -dynamiclib metaliskil.m -o /tmp/m && codesign -fs - /tmp/m && DYLD_INSERT_LIBRARIES=/tmp/m /S*/A*/Maps.app/C*/M*/Maps
@import Metal;
@import CoreGraphics;
#import "dyld-interposing.h"
#define trace NSLog
id fake_MTLCreateSystemDefaultDevice()
{
trace(@"Amy stub MTLCreateSystemDefaultDevice %@",NSThread.callStackSymbols);
return nil;
}
DYLD_INTERPOSE(fake_MTLCreateSystemDefaultDevice,MTLCreateSystemDefaultDevice)
NSArray* fake_MTLCopyAllDevices()
{
trace(@"Amy stub MTLCopyAllDevices %@",NSThread.callStackSymbols);
return NSArray.alloc.init;
}
DYLD_INTERPOSE(fake_MTLCopyAllDevices,MTLCopyAllDevices)
NSArray* fake_MTLCopyAllDevicesWithObserver(id observer,MTLDeviceNotificationHandler handler)
{
trace(@"Amy stub MTLCopyAllDevicesWithObserver %@",NSThread.callStackSymbols);
return NSArray.alloc.init;
}
DYLD_INTERPOSE(fake_MTLCopyAllDevicesWithObserver,MTLCopyAllDevicesWithObserver)
id fake_CGDirectDisplayCopyCurrentMetalDevice(CGDirectDisplayID display)
{
trace(@"Amy stub CGDirectDisplayCopyCurrentMetalDevice %@",NSThread.callStackSymbols);
return nil;
}
DYLD_INTERPOSE(fake_CGDirectDisplayCopyCurrentMetalDevice,CGDirectDisplayCopyCurrentMetalDevice)