Files
Gryphn/projects/apis/metal/src/presentation_queue/metal_presentation_queue.h
2025-07-11 14:02:55 -04:00

27 lines
1.0 KiB
Objective-C

#pragma once
#import <Metal/Metal.h>
#include "presentation_queue/gryphn_presentation_queue.h"
typedef id<MTLTexture> metalTexture;
GN_ARRAY_LIST(metalTexture);
typedef struct mtlImageNeeded {
gnSemaphore semaphoreToSignal;
uint32_t* whereToPut;
} mtlImageNeeded;
GN_ARRAY_LIST(mtlImageNeeded);
typedef struct gnPlatformPresentationQueue_t {
metalTextureArrayList textures;
uint32_tArrayList avaliableTextures;
mtlImageNeededArrayList neededImages;
} gnPlatformPresentationQueue;
gnReturnCode createMetalPresentationQueue(gnPresentationQueueHandle presentationQueue, const gnDevice device, gnPresentationQueueInfo presentationInfo);
gnReturnCode getMetalPresentQueueImageAsync(gnPresentationQueueHandle presentationQueue, uint64_t timeout, gnSemaphore semaphore, uint32_t* imageIndex);
gnReturnCode getMetalPresentQueueImage(gnPresentationQueueHandle presentationQueue, uint32_t* imageIndex);
void destroyMetalPresentationQueue(gnPresentationQueueHandle presentationQueue);
void mtlAddImageBackToQueue(gnPresentationQueue queue, uint32_t index);