sync primative handles

This commit is contained in:
Greg Wells
2025-06-05 22:19:38 -04:00
parent 4349f76ede
commit d5d339105d
17 changed files with 78 additions and 69 deletions

View File

@@ -6,19 +6,19 @@
gnReturnCode gnSubmitFn(struct gnOutputDevice_t* device, struct gnSubmitInfo_t info) {
for (int i = 0; i < info.waitCount; i++) {
while (!info.waitSemaphores[i].semaphore->eventTriggered) {}
while (!info.waitSemaphores[i]->semaphore->eventTriggered) {}
}
__block gnSemaphore* semsToSignal = info.signalSemaphores;
__block int semsToSignalCount = info.signalCount;
__block gnFence* fenceToSignal = info.fence;
__block gnFence fenceToSignal = info.fence;
for (int i = 0; i < info.commandBufferCount; i++) {
id<MTLCommandBuffer> commandBuffer = info.commandBuffers[i]->commandBuffer->commandBuffer;
[info.commandBuffers[i]->commandBuffer->commandBuffer addCompletedHandler:^(id<MTLCommandBuffer> buffer) {
for (int c = 0; c < semsToSignalCount; c++) {
semsToSignal[c].semaphore->eventTriggered = gnTrue;
semsToSignal[c]->semaphore->eventTriggered = gnTrue;
}
}];
fenceToSignal->signaled = gnTrue;