Fix compilation on iOS where setDisplaySyncEnabled isn't available.

Bug: dawn:269
Change-Id: I607983aaf437c39082156151b79887e72d529247
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18260
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-03-30 20:45:05 +00:00 committed by Commit Bot service account
parent a0d8362e00
commit d25b8e14f4
1 changed files with 3 additions and 1 deletions

View File

@ -84,9 +84,11 @@ namespace dawn_native { namespace metal {
[mLayer setDevice:ToBackend(GetDevice())->GetMTLDevice()]; [mLayer setDevice:ToBackend(GetDevice())->GetMTLDevice()];
[mLayer setPixelFormat:MetalPixelFormat(GetFormat())]; [mLayer setPixelFormat:MetalPixelFormat(GetFormat())];
if (@available(macos 10.13, ios 11.0, *)) { #if defined(DAWN_PLATFORM_MACOS)
if (@available(macos 10.13, *)) {
[mLayer setDisplaySyncEnabled:(GetPresentMode() != wgpu::PresentMode::Immediate)]; [mLayer setDisplaySyncEnabled:(GetPresentMode() != wgpu::PresentMode::Immediate)];
} }
#endif // defined(DAWN_PLATFORM_MACOS)
// There is no way to control Fifo vs. Mailbox in Metal. // There is no way to control Fifo vs. Mailbox in Metal.
} }