Query API: Re-enable Timestamp Query on Metal

Add timestamp query back in Metal supported extensions, and calculate
the timestamp period based on CPU timestamps and GPU timestamps sampled
on device.

There is a crash issue (dawn:545) on macOS 10.15 on AMD devices, but
cannot be reproduced on macOS 11.0+, we can just disable it on AMD with
macOS 10.15 in the following CL.

Bug: dawn:434
Change-Id: Icb4823e7c3115776e64c6a41fd0aea0f6536ccdf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51720
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Hao Li
2021-06-07 03:17:10 +00:00
committed by Dawn LUCI CQ
parent adc5cddde0
commit 84481bbb35
4 changed files with 111 additions and 7 deletions

View File

@@ -534,8 +534,8 @@ TEST_P(TimestampQueryTests, QuerySetCreation) {
// Test calling timestamp query from command encoder
TEST_P(TimestampQueryTests, TimestampOnCommandEncoder) {
// TODO(hao.x.li@intel.com): Crash occurs if we only call WriteTimestamp in a command encoder
// without any copy commands on Metal on AMD GPU. See https://crbug.com/dawn/545.
// 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;