From 008cba9b29ef921a966b82a6c7a29eea024e13c5 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Mon, 11 Oct 2021 13:50:29 +0000 Subject: [PATCH] Reenable timestamp queries on Metal macOS 11 They were previously disabled due to some new Metal alignement constraint that has now been upstreamed in WebGPU and implemented in Dawn. So we can reenable them. Bug: dawn:940 Change-Id: I96e5ac57342fbc0cab09989fe90a6bc4c8f9f40d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66120 Auto-Submit: Corentin Wallez Reviewed-by: Hao Li Reviewed-by: Austin Eng Commit-Queue: Austin Eng --- src/dawn_native/metal/BackendMTL.mm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dawn_native/metal/BackendMTL.mm b/src/dawn_native/metal/BackendMTL.mm index d25069885d..48bbb4b2fa 100644 --- a/src/dawn_native/metal/BackendMTL.mm +++ b/src/dawn_native/metal/BackendMTL.mm @@ -296,15 +296,16 @@ namespace dawn_native { namespace metal { if (IsGPUCounterSupported(*mDevice, MTLCommonCounterSetTimestamp, {MTLCommonCounterTimestamp})) { + bool enableTimestampQuery = true; + +#if defined(DAWN_PLATFORM_MACOS) // Disable timestamp query on macOS 10.15 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 - BOOL enableTimestampQuery = !gpu_info::IsAMD(GetPCIInfo().vendorId); -#if defined(DAWN_PLATFORM_MACOS) - // TODO(crbug.com/dawn/940): Disable timestamp query on macOS 11.0+. Need to - // figure out what to do with dstOffset alignment on that system. - enableTimestampQuery &= !IsMacOSVersionAtLeast(11); + enableTimestampQuery &= + !(gpu_info::IsAMD(GetPCIInfo().vendorId) && IsMacOSVersionAtLeast(11)); #endif + if (enableTimestampQuery) { mSupportedFeatures.EnableFeature(Feature::TimestampQuery); }