metal sync extension
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "commands/command_buffer/metal_command_buffer.h"
|
||||
#include "debugger/gryphn_debugger.h"
|
||||
#include "commands/command_pool/metal_command_pool.h"
|
||||
#include "sync/fence/gryphn_fence.h"
|
||||
#include "synchronization/commands/gryphn_sync_submit.h"
|
||||
|
||||
gnReturnCode metalSyncSubmit(gnOutputDevice device, gnSubmitSyncInfo info);
|
||||
gnReturnCode metalSubmit(gnOutputDevice device, gnSubmitInfo info);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "metal_submit.h"
|
||||
#include "synchronization/fence/gryphn_fence.h"
|
||||
|
||||
gnReturnCode metalSubmit(gnOutputDevice device, gnSubmitInfo info) {
|
||||
gnReturnCode metalSyncSubmit(gnOutputDevice device, gnSubmitSyncInfo info) {
|
||||
for (int i = 0; i < info.waitCount; i++) {
|
||||
while (!info.waitSemaphores[i]->semaphore->eventTriggered) {}
|
||||
}
|
||||
@@ -23,3 +24,13 @@ gnReturnCode metalSubmit(gnOutputDevice device, gnSubmitInfo info) {
|
||||
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
||||
gnReturnCode metalSubmit(gnOutputDevice device, gnSubmitInfo info) {
|
||||
for (int i = 0; i < info.commandBufferCount; i++) {
|
||||
id<MTLCommandBuffer> commandBuffer = info.commandBuffers[i]->commandBuffer->commandBuffer;
|
||||
[commandBuffer commit];
|
||||
}
|
||||
|
||||
[info.commandBuffers[info.commandBufferCount - 1]->commandBuffer->commandBuffer waitUntilCompleted];
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user