From 377ead9d448eb42342c0a957e6e3e4b485c4f7c7 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Sat, 5 Feb 2022 03:30:05 +0000 Subject: [PATCH] Fix version check for timestamp queries - Mac 11.0+ AMD Bug: dawn:545 Change-Id: I7cb48813e0a582a6b7314c6fa726800b146ea6be Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79243 Reviewed-by: Loko Kung Commit-Queue: Austin Eng --- src/dawn/native/metal/BackendMTL.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dawn/native/metal/BackendMTL.mm b/src/dawn/native/metal/BackendMTL.mm index 8650fe8838..52bcda76a0 100644 --- a/src/dawn/native/metal/BackendMTL.mm +++ b/src/dawn/native/metal/BackendMTL.mm @@ -307,11 +307,12 @@ namespace dawn::native::metal { bool enableTimestampQuery = true; #if defined(DAWN_PLATFORM_MACOS) - // Disable timestamp query on macOS 10.15 on AMD GPU because WriteTimestamp + // Disable timestamp query on < macOS 11.0 on AMD GPU because WriteTimestamp // fails to call without any copy commands on MTLBlitCommandEncoder. This issue - // has been fixed on macOS 11.0. See crbug.com/dawn/545 - enableTimestampQuery &= - !(gpu_info::IsAMD(mVendorId) && IsMacOSVersionAtLeast(11)); + // has been fixed on macOS 11.0. See crbug.com/dawn/545. + if (gpu_info::IsAMD(mVendorId) && !IsMacOSVersionAtLeast(11)) { + enableTimestampQuery = false; + } #endif if (enableTimestampQuery) {