Slab-allocate VkDescriptorSets

This introduces a slab allocator for VkDescriptorSets which creates
a VkDescriptorPool pre-allocated with multiple VkDescriptorSets per
BindGroupLayout. In the future, we can deduplicate pools that have
the same, or roughly the same, descriptor counts.

This CL also removes the old DescriptorSetService and moves most of
the functionality onto the DescriptorSetAllocator itself to keep
the tracking logic in one place.

Bug: dawn:340
Change-Id: I785b17f4353fb3d40c9ccc33746600d6794efe7c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng
2020-04-22 23:22:40 +00:00
committed by Commit Bot service account
parent f56f19059b
commit 96c4019214
14 changed files with 318 additions and 214 deletions

View File

@@ -288,6 +288,10 @@ TEST_P(DeprecationTests, BGDescBindingAndEntriesBothZeroEmitsNoWarning) {
// Test that creating a BG with bindings still does correct state tracking
TEST_P(DeprecationTests, BGDescBindingStateTracking) {
// TODO(cwallez@chromium.org): In Vulkan it is disallowed to create 0-sized descriptor pools
// but the Vulkan backend doesn't special case it yet.
DAWN_SKIP_TEST_IF(IsVulkan());
wgpu::BindGroupLayout layout = utils::MakeBindGroupLayout(device, {});
// Test a case where if |bindings| wasn't taken into account, no validation error would happen