mirror of
https://github.com/UniXNU/NativeMetal.git
synced 2026-11-20 18:37:22 +03:00
feat: build for macOS
This commit is contained in:
@@ -5,7 +5,17 @@
|
||||
// or operational overrides beyond IOService. This declares a real ancestry;
|
||||
// no original class, method, vtable or metaclass is replaced.
|
||||
#include <IOKit/IOService.h>
|
||||
#if XNU_TARGET_OS_OSX
|
||||
// macOS: the accelerator base is IOGraphicsFamily's IOAccelerator, of the same shape (136 bytes, no overrides beyond the
|
||||
// destructors and getMetaClass); IOGPU's Metal discovery matches IOServiceMatching("IOAccelerator").
|
||||
class IOAccelerator : public IOService {
|
||||
OSDeclareAbstractStructors(IOAccelerator)
|
||||
};
|
||||
#define NATIVE_ACCELERATOR_BASE IOAccelerator
|
||||
#else
|
||||
class IOAcceleratorES : public IOService {
|
||||
OSDeclareAbstractStructors(IOAcceleratorES)
|
||||
};
|
||||
static_assert(sizeof(IOService)==136 && sizeof(IOAcceleratorES)==136,"Qualified original accelerator base extent");
|
||||
#define NATIVE_ACCELERATOR_BASE IOAcceleratorES
|
||||
#endif
|
||||
static_assert(sizeof(IOService)==136 && sizeof(NATIVE_ACCELERATOR_BASE)==136,"Qualified original accelerator base extent");
|
||||
|
||||
Reference in New Issue
Block a user