mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
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
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user