Enable dynamic storage buffers

Validation is implemented with CTS tests added in
https://github.com/gpuweb/cts/pull/850

Fixed: dawn:429
Change-Id: Iee570c712f81fbafc158c0ceec89a28011a3fed8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71960
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng
2021-12-10 01:50:08 +00:00
committed by Dawn LUCI CQ
parent a840574db0
commit 6ad6278bc5
2 changed files with 0 additions and 49 deletions

View File

@@ -28,44 +28,6 @@ class UnsafeAPIValidationTest : public ValidationTest {
}
};
// Check that dynamic storage buffers are disallowed.
TEST_F(UnsafeAPIValidationTest, DynamicStorageBuffer) {
wgpu::BindGroupLayoutEntry entry;
entry.visibility = wgpu::ShaderStage::Fragment;
wgpu::BindGroupLayoutDescriptor desc;
desc.entries = &entry;
desc.entryCount = 1;
// Control case: storage buffer without a dynamic offset is allowed.
{
entry.buffer.type = wgpu::BufferBindingType::Storage;
entry.buffer.hasDynamicOffset = false;
device.CreateBindGroupLayout(&desc);
}
// Control case: readonly storage buffer without a dynamic offset is allowed.
{
entry.buffer.type = wgpu::BufferBindingType::ReadOnlyStorage;
entry.buffer.hasDynamicOffset = false;
device.CreateBindGroupLayout(&desc);
}
// Storage buffer with a dynamic offset is disallowed.
{
entry.buffer.type = wgpu::BufferBindingType::Storage;
entry.buffer.hasDynamicOffset = true;
ASSERT_DEVICE_ERROR(device.CreateBindGroupLayout(&desc));
}
// Readonly storage buffer with a dynamic offset is disallowed.
{
entry.buffer.type = wgpu::BufferBindingType::ReadOnlyStorage;
entry.buffer.hasDynamicOffset = true;
ASSERT_DEVICE_ERROR(device.CreateBindGroupLayout(&desc));
}
}
// Check that pipeline overridable constants are disallowed as part of unsafe APIs.
// TODO(dawn:1041) Remove when implementation for all backend is added
TEST_F(UnsafeAPIValidationTest, PipelineOverridableConstants) {