Fix build errors on Simulator not supporting MTLDrawable present time options.
This commit is contained in:
parent
dd59aea71f
commit
5f6dd8fe81
@ -1179,6 +1179,11 @@ void MVKPresentableSwapchainImage::presentCAMetalDrawable(id<MTLCommandBuffer> m
|
||||
}];
|
||||
|
||||
if (hasPresentTime) {
|
||||
#if MVK_OS_SIMULATOR
|
||||
// If MTLDrawable.presentedTime/addPresentedHandler isn't supported, just treat it as if the
|
||||
// present happened when requested
|
||||
_swapchain->recordPresentTime(presentID, desiredPresentTime, desiredPresentTime);
|
||||
#else
|
||||
if ([_mtlDrawable respondsToSelector: @selector(addPresentedHandler:)]) {
|
||||
[_mtlDrawable addPresentedHandler: ^(id<MTLDrawable> drawable) {
|
||||
// Record the presentation time
|
||||
@ -1191,7 +1196,9 @@ void MVKPresentableSwapchainImage::presentCAMetalDrawable(id<MTLCommandBuffer> m
|
||||
// present happened when requested
|
||||
_swapchain->recordPresentTime(presentID, desiredPresentTime, desiredPresentTime);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Resets the MTLTexture and CAMetalDrawable underlying this image.
|
||||
|
@ -78,7 +78,7 @@ MVKSemaphoreImpl::~MVKSemaphoreImpl() {
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark MVKSemaphoreMTLEvent
|
||||
#pragma mark MVKSemaphoreMTLFence
|
||||
|
||||
// Could use any encoder. Assume BLIT is fastest and lightest.
|
||||
// Nil mtlCmdBuff will do nothing.
|
||||
|
Loading…
x
Reference in New Issue
Block a user