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