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>
diff --git a/src/dawn_native/metal/SwapChainMTL.mm b/src/dawn_native/metal/SwapChainMTL.mm
index 54d5af2..b0dcdc8 100644
--- a/src/dawn_native/metal/SwapChainMTL.mm
+++ b/src/dawn_native/metal/SwapChainMTL.mm
@@ -84,9 +84,11 @@
[mLayer setDevice:ToBackend(GetDevice())->GetMTLDevice()];
[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)];
}
+#endif // defined(DAWN_PLATFORM_MACOS)
// There is no way to control Fifo vs. Mailbox in Metal.
}