Add internal compute pipeline in ResolveQuerySet for Timestamp Query

- Enable internal compute pipeline in ResolveQuerySet for Timestamp
  Query.
- Known issue:
  The user-provided resolve buffer cannot be used as binding resources
  due to missing STORAGE usage. Currently implictly add STORAGE usage
  if the buffer is created with QUERY_RESOLVE usage as a workaround.
  Next we will add STORAGE_INTERNAL usage instead.

Bug: dawn:434
Change-Id: Ie66090de38bc3a04a58986669cd2a128b528f960
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36222
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This commit is contained in:
Hao Li
2021-01-14 03:26:08 +00:00
committed by Commit Bot service account
parent 8c58491d25
commit 6f833b7f78
5 changed files with 78 additions and 0 deletions

View File

@@ -1206,6 +1206,10 @@ TEST_P(BufferZeroInitTest, ResolveQuerySet) {
// Skip if timestamp extension is not supported on device
DAWN_SKIP_TEST_IF(!SupportsExtensions({"timestamp_query"}));
// TODO(crbug.com/tint/255, crbug.com/tint/256, crbug.com/tint/400, crbug.com/tint/417):
// Skip use_tint_generator due to runtime array not supported in WGSL
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
constexpr uint64_t kBufferSize = 16u;
constexpr wgpu::BufferUsage kBufferUsage =
wgpu::BufferUsage::QueryResolve | wgpu::BufferUsage::CopyDst;

View File

@@ -284,6 +284,10 @@ class TimestampQueryTests : public QueryTests {
// Skip all tests if timestamp extension is not supported
DAWN_SKIP_TEST_IF(!SupportsExtensions({"timestamp_query"}));
// TODO(crbug.com/tint/255, crbug.com/tint/256, crbug.com/tint/400, crbug.com/tint/417):
// Skip use_tint_generator due to runtime array not supported in WGSL
DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator"));
}
std::vector<const char*> GetRequiredExtensions() override {

View File

@@ -434,6 +434,23 @@ TEST_F(BindGroupValidationTest, BufferUsageReadonlySSBO) {
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, mUBO, 0, 256}}));
}
// Check that a resolve buffer with internal storge usage cannot be used as SSBO
// TODO(hao.x.li@intel.com): Disable until internal storage usage is implemented
TEST_F(BindGroupValidationTest, DISABLED_BufferUsageQueryResolve) {
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Fragment, wgpu::BufferBindingType::Storage}});
// Control case: using a buffer with the storage usage works
utils::MakeBindGroup(device, layout, {{0, mSSBO, 0, 256}});
// Using a resolve buffer with the internal storage usage fails
wgpu::BufferDescriptor descriptor;
descriptor.size = 1024;
descriptor.usage = wgpu::BufferUsage::QueryResolve;
wgpu::Buffer buffer = device.CreateBuffer(&descriptor);
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, buffer, 0, 256}}));
}
// Tests constraints on the buffer offset for bind groups.
TEST_F(BindGroupValidationTest, BufferOffsetAlignment) {
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(