vkd3d: Create descriptor pools of geometrically increasing size.

Creating a pool of 16k descriptors is wasteful if an allocator only uses
a fraction of them, so start at 1k and double for each subsequent
allocation until 16k is reached.
This commit is contained in:
Conor McCarthy
2024-09-17 13:55:19 +10:00
committed by Henri Verbeet
parent e729ceeb1a
commit a43f6a6600
Notes: Henri Verbeet 2024-12-05 21:35:35 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1088
4 changed files with 100 additions and 27 deletions

View File

@@ -1488,12 +1488,25 @@ static HRESULT vkd3d_create_pipeline_layout(struct d3d12_device *device,
static HRESULT d3d12_descriptor_set_layout_init(struct d3d12_descriptor_set_layout *layout,
struct d3d12_device *device, const struct vk_binding_array *array)
{
unsigned int descriptor_count;
bool unbounded;
HRESULT hr;
size_t i;
if (FAILED(hr = vkd3d_create_descriptor_set_layout(device, array->flags, array->count,
array->unbounded_offset != UINT_MAX, array->bindings, &layout->vk_layout)))
descriptor_count = array->unbounded_offset;
if (!(unbounded = descriptor_count != UINT_MAX))
{
for (i = 0, descriptor_count = 0; i < array->count; ++i)
{
descriptor_count += array->bindings[i].descriptorCount;
}
}
if (FAILED(hr = vkd3d_create_descriptor_set_layout(device, array->flags,
array->count, unbounded, array->bindings, &layout->vk_layout)))
return hr;
layout->descriptor_type = array->descriptor_type;
layout->descriptor_count = descriptor_count;
layout->unbounded_offset = array->unbounded_offset;
layout->table_index = array->table_index;