mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 16:16:08 +00:00
Query API: Timestamp Query on Metal
- Add WriteTimestamp and ResolveQuerySet on Metal - Enable end2end tests of timestamp query on Metal - Lazy initialize the distination buffer in ResolveQuerySet - Update part of end2end tests to test from render pass instead of command encoder due to we cannot write timestamp on CommandEncoder without any copy commands on Metal. Bug: dawn:434 Change-Id: Ie9217e1f5a00bc252d6293ef7521c2e343ba9259 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29020 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com> Commit-Queue: Hao Li <hao.x.li@intel.com>
This commit is contained in:
committed by
Commit Bot service account
parent
6c3da3dc5b
commit
936ef0a5f2
@@ -1120,7 +1120,7 @@ TEST_P(BufferZeroInitTest, SetIndexBuffer) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test the buffer will be lazily intialized correctly when its first use is an indirect buffer for
|
||||
// Test the buffer will be lazily initialized correctly when its first use is an indirect buffer for
|
||||
// DrawIndirect.
|
||||
TEST_P(BufferZeroInitTest, IndirectBufferForDrawIndirect) {
|
||||
// Bind the whole buffer as an indirect buffer.
|
||||
@@ -1136,7 +1136,7 @@ TEST_P(BufferZeroInitTest, IndirectBufferForDrawIndirect) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test the buffer will be lazily intialized correctly when its first use is an indirect buffer for
|
||||
// Test the buffer will be lazily initialized correctly when its first use is an indirect buffer for
|
||||
// DrawIndexedIndirect.
|
||||
TEST_P(BufferZeroInitTest, IndirectBufferForDrawIndexedIndirect) {
|
||||
// Bind the whole buffer as an indirect buffer.
|
||||
@@ -1152,7 +1152,7 @@ TEST_P(BufferZeroInitTest, IndirectBufferForDrawIndexedIndirect) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test the buffer will be lazily intialized correctly when its first use is an indirect buffer for
|
||||
// Test the buffer will be lazily initialized correctly when its first use is an indirect buffer for
|
||||
// DispatchIndirect.
|
||||
TEST_P(BufferZeroInitTest, IndirectBufferForDispatchIndirect) {
|
||||
// Bind the whole buffer as an indirect buffer.
|
||||
@@ -1168,13 +1168,14 @@ TEST_P(BufferZeroInitTest, IndirectBufferForDispatchIndirect) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test the buffer will be lazily intialized correctly when its first use is in resolveQuerySet
|
||||
// Test the buffer will be lazily initialized correctly when its first use is in resolveQuerySet
|
||||
TEST_P(BufferZeroInitTest, ResolveQuerySet) {
|
||||
// Timestamp query is not supported on OpenGL
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL());
|
||||
|
||||
// TODO(hao.x.li@intel.com): Remove it after timestamp query is implementated on Metal
|
||||
DAWN_SKIP_TEST_IF(IsMetal());
|
||||
// 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.
|
||||
DAWN_SKIP_TEST_IF(IsMetal() && IsAMD());
|
||||
|
||||
// Skip if timestamp extension is not supported on device
|
||||
DAWN_SKIP_TEST_IF(!SupportsExtensions({"timestamp_query"}));
|
||||
|
||||
@@ -141,8 +141,9 @@ TEST_P(TimestampQueryTests, QuerySetCreation) {
|
||||
|
||||
// Test calling timestamp query from command encoder
|
||||
TEST_P(TimestampQueryTests, TimestampOnCommandEncoder) {
|
||||
// TODO(hao.x.li@intel.com): Waiting for timestamp query implementation on Metal
|
||||
DAWN_SKIP_TEST_IF(IsMetal());
|
||||
// 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.
|
||||
DAWN_SKIP_TEST_IF(IsMetal() && IsAMD());
|
||||
|
||||
constexpr uint32_t kQueryCount = 2;
|
||||
|
||||
@@ -161,9 +162,6 @@ TEST_P(TimestampQueryTests, TimestampOnCommandEncoder) {
|
||||
|
||||
// Test calling timestamp query from render pass encoder
|
||||
TEST_P(TimestampQueryTests, TimestampOnRenderPass) {
|
||||
// TODO(hao.x.li@intel.com): Waiting for timestamp query implementation on Metal
|
||||
DAWN_SKIP_TEST_IF(IsMetal());
|
||||
|
||||
constexpr uint32_t kQueryCount = 2;
|
||||
|
||||
wgpu::QuerySet querySet = CreateQuerySetForTimestamp(kQueryCount);
|
||||
@@ -184,9 +182,6 @@ TEST_P(TimestampQueryTests, TimestampOnRenderPass) {
|
||||
|
||||
// Test calling timestamp query from compute pass encoder
|
||||
TEST_P(TimestampQueryTests, TimestampOnComputePass) {
|
||||
// TODO(hao.x.li@intel.com): Waiting for timestamp query implementation on Metal
|
||||
DAWN_SKIP_TEST_IF(IsMetal());
|
||||
|
||||
constexpr uint32_t kQueryCount = 2;
|
||||
|
||||
wgpu::QuerySet querySet = CreateQuerySetForTimestamp(kQueryCount);
|
||||
@@ -206,11 +201,14 @@ TEST_P(TimestampQueryTests, TimestampOnComputePass) {
|
||||
|
||||
// Test resolving timestamp query to one slot in the buffer
|
||||
TEST_P(TimestampQueryTests, ResolveToBufferWithOffset) {
|
||||
// TODO(hao.x.li@intel.com): Failed on old Intel Vulkan driver on Windows, need investigation.
|
||||
// TODO(hao.x.li@intel.com): Fail to resolve query to buffer with offset on Windows Vulkan and
|
||||
// Metal on Intel platforms, need investigation.
|
||||
DAWN_SKIP_TEST_IF(IsWindows() && IsIntel() && IsVulkan());
|
||||
DAWN_SKIP_TEST_IF(IsIntel() && IsMetal());
|
||||
|
||||
// TODO(hao.x.li@intel.com): Waiting for timestamp query implementation on Metal
|
||||
DAWN_SKIP_TEST_IF(IsMetal());
|
||||
// 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.
|
||||
DAWN_SKIP_TEST_IF(IsMetal() && IsAMD());
|
||||
|
||||
constexpr uint32_t kQueryCount = 2;
|
||||
constexpr uint64_t kZero = 0;
|
||||
|
||||
Reference in New Issue
Block a user