panvk: remove descriptor pool counters
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29250>
This commit is contained in:
committed by
Marge Bot
parent
bb09fac659
commit
0d59fe21ce
@@ -25,26 +25,8 @@ struct panvk_descriptor_pool;
|
||||
struct panvk_descriptor_set_layout;
|
||||
struct panvk_priv_bo;
|
||||
|
||||
struct panvk_desc_pool_counters {
|
||||
unsigned samplers;
|
||||
unsigned combined_image_samplers;
|
||||
unsigned sampled_images;
|
||||
unsigned storage_images;
|
||||
unsigned uniform_texel_bufs;
|
||||
unsigned storage_texel_bufs;
|
||||
unsigned input_attachments;
|
||||
unsigned uniform_bufs;
|
||||
unsigned storage_bufs;
|
||||
unsigned uniform_dyn_bufs;
|
||||
unsigned storage_dyn_bufs;
|
||||
unsigned sets;
|
||||
};
|
||||
|
||||
struct panvk_descriptor_pool {
|
||||
struct vk_object_base base;
|
||||
struct panvk_desc_pool_counters max;
|
||||
struct panvk_desc_pool_counters cur;
|
||||
struct panvk_descriptor_set *sets;
|
||||
};
|
||||
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_descriptor_pool, base, VkDescriptorPool,
|
||||
|
||||
@@ -67,50 +67,6 @@ panvk_per_arch(CreateDescriptorPool)(
|
||||
if (!pool)
|
||||
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
|
||||
pool->max.sets = pCreateInfo->maxSets;
|
||||
|
||||
for (unsigned i = 0; i < pCreateInfo->poolSizeCount; ++i) {
|
||||
unsigned desc_count = pCreateInfo->pPoolSizes[i].descriptorCount;
|
||||
|
||||
switch (pCreateInfo->pPoolSizes[i].type) {
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLER:
|
||||
pool->max.samplers += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
|
||||
pool->max.combined_image_samplers += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
|
||||
pool->max.sampled_images += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
|
||||
pool->max.storage_images += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
|
||||
pool->max.uniform_texel_bufs += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
|
||||
pool->max.storage_texel_bufs += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
|
||||
pool->max.input_attachments += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
|
||||
pool->max.uniform_bufs += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
|
||||
pool->max.storage_bufs += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
||||
pool->max.uniform_dyn_bufs += desc_count;
|
||||
break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
|
||||
pool->max.storage_dyn_bufs += desc_count;
|
||||
break;
|
||||
default:
|
||||
unreachable("Invalid descriptor type");
|
||||
}
|
||||
}
|
||||
|
||||
*pDescriptorPool = panvk_descriptor_pool_to_handle(pool);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
@@ -130,8 +86,6 @@ VKAPI_ATTR VkResult VKAPI_CALL
|
||||
panvk_per_arch(ResetDescriptorPool)(VkDevice _device, VkDescriptorPool _pool,
|
||||
VkDescriptorPoolResetFlags flags)
|
||||
{
|
||||
VK_FROM_HANDLE(panvk_descriptor_pool, pool, _pool);
|
||||
memset(&pool->cur, 0, sizeof(pool->cur));
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user