panvk: use vk_descriptor_type_is_dynamic

No need for our own helper now that we have a generic one.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32627>
This commit is contained in:
Erik Faye-Lund 2024-12-13 13:04:00 +01:00 committed by Marge Bot
parent ea88898b04
commit d188856ffd
2 changed files with 3 additions and 9 deletions

View file

@ -13,6 +13,7 @@
#include <stdint.h>
#include "vk_descriptor_set_layout.h"
#include "vk_util.h"
#include "util/mesa-blake3.h"

View file

@ -33,13 +33,6 @@
#include "panvk_priv_bo.h"
#include "panvk_sampler.h"
static inline const bool
is_dynamic_buffer(VkDescriptorType type)
{
return type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC;
}
static void *
get_desc_slot_ptr(struct panvk_descriptor_set *set, uint32_t binding,
uint32_t elem, VkDescriptorType type)
@ -246,7 +239,7 @@ panvk_per_arch(CreateDescriptorPool)(
uint32_t desc_count = 0;
for (unsigned i = 0; i < pCreateInfo->poolSizeCount; ++i) {
if (!is_dynamic_buffer(pCreateInfo->pPoolSizes[i].type))
if (!vk_descriptor_type_is_dynamic(pCreateInfo->pPoolSizes[i].type))
desc_count += panvk_get_desc_stride(pCreateInfo->pPoolSizes[i].type) *
pCreateInfo->pPoolSizes[i].descriptorCount;
}
@ -329,7 +322,7 @@ panvk_desc_pool_allocate_set(struct panvk_descriptor_pool *pool,
if ((layout->bindings[last_binding].flags &
VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT) &&
!is_dynamic_buffer(layout->bindings[last_binding].type)) {
!vk_descriptor_type_is_dynamic(layout->bindings[last_binding].type)) {
uint32_t desc_stride =
panvk_get_desc_stride(layout->bindings[last_binding].type);