wait for device
This commit is contained in:
@@ -17,6 +17,10 @@ gnReturnCode gnCreateOutputDeviceFn(gnOutputDevice* outputDevice, gnInstance* in
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
||||
void gnWaitForDeviceFn(gnOutputDevice *device) {
|
||||
[device->outputDevice->executingCommandBuffer waitUntilCompleted];
|
||||
}
|
||||
|
||||
void gnDestroyOutputDeviceFn(gnOutputDevice* device) {
|
||||
for (int i = 0; i < device->outputDevice->queueCount; i++) {
|
||||
[device->outputDevice->queues[i] release];
|
||||
|
@@ -15,5 +15,7 @@ struct gnPlatformOutputDevice_t {
|
||||
int queueCount;
|
||||
id<MTLCommandQueue>* queues;
|
||||
|
||||
id<MTLCommandBuffer> executingCommandBuffer;
|
||||
|
||||
id<MTLRenderPipelineState> framebuffer;
|
||||
} gnPlatformOutputDevice;
|
||||
|
@@ -42,7 +42,7 @@ gnReturnCode gnPresentFn(struct gnOutputDevice_t* device, struct gnPresentInfo_t
|
||||
|
||||
[commandBuffer presentDrawable:drawable];
|
||||
[commandBuffer commit];
|
||||
|
||||
device->outputDevice->executingCommandBuffer = commandBuffer;
|
||||
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user