Disable timestamp query on macOS 10.15 on AMD

On macOS 10.15 on AMD GPU, WriteTimestamp cannot be called without any
copy commands on MTLBlitCommandEncoder, otherwise crash occurs. But this
issue is not reproduced on macOS 11.0, just disable timestamp query on
the bad version on AMD.

BUG: dawn:545
Change-Id: I69a012b2091b8ccd251d23ddb26b72e06c07492f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53581
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This commit is contained in:
Hao Li 2021-06-09 01:33:46 +00:00 committed by Dawn LUCI CQ
parent c9a6df3297
commit b68ca071f3
2 changed files with 8 additions and 11 deletions

View File

@ -221,11 +221,16 @@ namespace dawn_native { namespace metal {
if ([*mDevice supportsFamily:MTLGPUFamilyMac2] ||
[*mDevice supportsFamily:MTLGPUFamilyApple5]) {
mSupportedExtensions.EnableExtension(Extension::PipelineStatisticsQuery);
// TODO(crbug.com/dawn/545): Crash occurs if we only call WriteTimestamp in a
// command encoder without any copy commands on Metal on AMD GPU.
// 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
if (!gpu_info::IsAMD(GetPCIInfo().vendorId) ||
[NSProcessInfo.processInfo isOperatingSystemAtLeastVersion:{11, 0, 0}]) {
mSupportedExtensions.EnableExtension(Extension::TimestampQuery);
}
}
}
if (@available(macOS 10.11, iOS 11.0, *)) {
mSupportedExtensions.EnableExtension(Extension::DepthClamping);
}

View File

@ -534,10 +534,6 @@ TEST_P(TimestampQueryTests, QuerySetCreation) {
// Test calling timestamp query from command encoder
TEST_P(TimestampQueryTests, TimestampOnCommandEncoder) {
// TODO(crbug.com/dawn/545): Crash occurs if we only call WriteTimestamp in a command encoder
// without any copy commands on Metal on AMD GPU.
DAWN_SUPPRESS_TEST_IF(IsMetal() && IsAMD());
constexpr uint32_t kQueryCount = 2;
// Write timestamp with different query indexes
@ -760,10 +756,6 @@ TEST_P(TimestampQueryTests, ResolveToBufferWithOffset) {
// the issue is fixed.
DAWN_SUPPRESS_TEST_IF(IsWindows() && IsVulkan() && IsIntel());
// TODO(crbug.com/dawn/545): Crash occurs if we only call WriteTimestamp in a command encoder
// without any copy commands on Metal on AMD GPU.
DAWN_SUPPRESS_TEST_IF(IsMetal() && IsAMD());
constexpr uint32_t kQueryCount = 2;
constexpr uint64_t kZero = 0;