kinda a metal semaphore class
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include "core/sync/semaphore/gryphn_semaphore.h"
|
||||
#import <Metal/MTLEvent.h>
|
||||
|
||||
typedef struct gnPlatformSemaphore_t {
|
||||
id<MTLEvent> event;
|
||||
} gnPlatformSemaphore;
|
@@ -0,0 +1,13 @@
|
||||
#include "metal_semaphore.h"
|
||||
#include "core/devices/metal_output_devices.h"
|
||||
|
||||
gnReturnCode gnCreateSemaphoreFn(struct gnSemaphore_t* semaphore, struct gnOutputDevice_t* device) {
|
||||
semaphore->semaphore = malloc(sizeof(gnPlatformSemaphore));
|
||||
semaphore->semaphore->event = [device->outputDevice->device newEvent];
|
||||
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
void gnDestroySemaphoreFn(struct gnSemaphore_t* semaphore) {
|
||||
[semaphore->semaphore->event release];
|
||||
free(semaphore->semaphore);
|
||||
}
|
Reference in New Issue
Block a user