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

@@ -1,10 +1,18 @@
#include "metal_submit.h"
#include "synchronization/fence/gryphn_fence.h"
#include "stdio.h"
#include "time.h"
gnReturnCode metalSyncSubmit(gnOutputDevice device, gnSubmitSyncInfo info) {
clock_t begin = clock();
for (int i = 0; i < info.waitCount; i++) {
while (!info.waitSemaphores[i]->semaphore->eventTriggered) {}
}
clock_t end = clock();
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
printf("time spent waiting for image in submit: %lf\n", time_spent);
__block gnSemaphore* semsToSignal = info.signalSemaphores;
__block int semsToSignalCount = info.signalCount;