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 <cwallez@chromium.org>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez 2021-10-11 13:50:29 +00:00 committed by Dawn LUCI CQ
parent 2d1762049b
commit 008cba9b29
1 changed files with 6 additions and 5 deletions

View File

@ -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);
}