redo presentation queue waiting

This commit is contained in:
Greg Wells
2025-07-11 14:02:55 -04:00
parent 04a19fce18
commit 2def510f69
5 changed files with 52 additions and 12 deletions

View File

@@ -5,12 +5,22 @@
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);