mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
Clear resolve buffer to 0 for resolving unavailable queries
- Add vkCmdFillBuffer in ResolveQuerySet to clear the buffer to 0s for these unavailable queries if the buffer has been initialized or fully used which won't been initialized with 0s again. - Because vkCmdFillBuffer has driver issue on Intel Windows, Skip some affected cases. - Remove unsafe api checking from Occlusion Query. Bug: dawn:434 Change-Id: Ib34f81d93b0de8f08f0eeebf3c8a967eeb5ecefb Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48320 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
b29467ba7b
commit
aed656cd7a
@@ -302,9 +302,10 @@ TEST_P(OcclusionQueryTests, Rewrite) {
|
||||
// Test resolving occlusion query correctly if the queries are written sparsely, which also tests
|
||||
// the query resetting at the start of render passes on Vulkan backend.
|
||||
TEST_P(OcclusionQueryTests, ResolveSparseQueries) {
|
||||
// TODO(hao.x.li@intel.com): Clear the resolve region of the buffer to 0 if there is at least
|
||||
// one query not written and the resolve buffer has been initialized or fully used.
|
||||
DAWN_SKIP_TEST_IF(IsVulkan());
|
||||
// TODO(hao.x.li@intel.com): Fails on Intel Windows Vulkan due to a driver issue that
|
||||
// vkCmdFillBuffer and vkCmdCopyQueryPoolResults are not executed in order, skip it util
|
||||
// the issue is fixed.
|
||||
DAWN_SKIP_TEST_IF(IsWindows() && IsVulkan() && IsIntel());
|
||||
|
||||
// TODO(hao.x.li@intel.com): Investigate why it's failed on D3D12 on Nvidia when running with
|
||||
// the previous occlusion tests. Expect resolve to 0 for these unwritten queries but the
|
||||
@@ -366,10 +367,6 @@ TEST_P(OcclusionQueryTests, ResolveSparseQueries) {
|
||||
|
||||
// Test resolving occlusion query to 0 if all queries are not written
|
||||
TEST_P(OcclusionQueryTests, ResolveWithoutWritten) {
|
||||
// TODO(hao.x.li@intel.com): Clear the resolve region of the buffer to 0 if there is at least
|
||||
// one query not written and the resolve buffer has been initialized or fully used.
|
||||
DAWN_SKIP_TEST_IF(IsVulkan());
|
||||
|
||||
// TODO(hao.x.li@intel.com): Investigate why it's failed on D3D12 on Nvidia when running with
|
||||
// the previous occlusion tests. Expect resolve to 0 but the occlusion result of the previous
|
||||
// tests is got.
|
||||
@@ -707,6 +704,11 @@ TEST_P(TimestampQueryTests, ResolveFromAnotherEncoder) {
|
||||
|
||||
// Test resolving timestamp query correctly if the queries are written sparsely
|
||||
TEST_P(TimestampQueryTests, ResolveSparseQueries) {
|
||||
// TODO(hao.x.li@intel.com): Fails on Intel Windows Vulkan due to a driver issue that
|
||||
// vkCmdFillBuffer and vkCmdCopyQueryPoolResults are not executed in order, skip it util
|
||||
// the issue is fixed.
|
||||
DAWN_SKIP_TEST_IF(IsWindows() && IsVulkan() && IsIntel());
|
||||
|
||||
constexpr uint32_t kQueryCount = 4;
|
||||
|
||||
wgpu::QuerySet querySet = CreateQuerySetForTimestamp(kQueryCount);
|
||||
|
||||
@@ -201,32 +201,3 @@ TEST_F(UnsafeAPIValidationTest, DynamicStorageBuffer) {
|
||||
ASSERT_DEVICE_ERROR(device.CreateBindGroupLayout(&desc));
|
||||
}
|
||||
}
|
||||
|
||||
// Check that occlusion query is disallowed as part of unsafe APIs.
|
||||
TEST_F(UnsafeAPIValidationTest, OcclusionQueryDisallowed) {
|
||||
DummyRenderPass renderPass(device);
|
||||
|
||||
// Control case: BeginRenderPass without occlusionQuerySet is allowed.
|
||||
{
|
||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
|
||||
pass.EndPass();
|
||||
encoder.Finish();
|
||||
}
|
||||
|
||||
// Error case: BeginRenderPass with occlusionQuerySet is disallowed.
|
||||
{
|
||||
wgpu::QuerySetDescriptor descriptor;
|
||||
descriptor.type = wgpu::QueryType::Occlusion;
|
||||
descriptor.count = 1;
|
||||
wgpu::QuerySet querySet = device.CreateQuerySet(&descriptor);
|
||||
renderPass.occlusionQuerySet = querySet;
|
||||
|
||||
wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass);
|
||||
|
||||
pass.EndPass();
|
||||
ASSERT_DEVICE_ERROR(encoder.Finish());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user