dozen: 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>
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 65e62a4c96
commit ea88898b04

View file

@ -84,13 +84,6 @@ desc_type_to_range_type(VkDescriptorType in, bool writeable)
}
}
static bool
is_dynamic_desc_type(VkDescriptorType desc_type)
{
return (desc_type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
desc_type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC);
}
static bool
is_buffer_desc_type_without_view(VkDescriptorType desc_type)
{
@ -218,7 +211,7 @@ dzn_descriptor_set_layout_create(struct dzn_device *device,
uint32_t factor =
dzn_descriptor_type_depends_on_shader_usage(desc_type, device->bindless) ? 2 : 1;
if (is_dynamic_desc_type(desc_type))
if (vk_descriptor_type_is_dynamic(desc_type))
dynamic_buffer_count += bindings[i].descriptorCount * factor;
else
dynamic_ranges_offset += bindings[i].descriptorCount * factor;
@ -304,7 +297,7 @@ dzn_descriptor_set_layout_create(struct dzn_device *device,
ordered_bindings[i].pImmutableSamplers != NULL;
bool has_static_sampler = device->support_static_samplers &&
has_immutable_samplers && desc_count == 1;
bool is_dynamic = is_dynamic_desc_type(desc_type);
bool is_dynamic = vk_descriptor_type_is_dynamic(desc_type);
D3D12_SHADER_VISIBILITY visibility = device->bindless ?
D3D12_SHADER_VISIBILITY_ALL :
@ -679,7 +672,7 @@ dzn_pipeline_layout_create(struct dzn_device *device,
for (uint32_t b = 0; b < set_layout->binding_count; b++) {
binding_trans[b] = set_layout->bindings[b].base_shader_register;
if (is_dynamic_desc_type(set_layout->bindings[b].type)) {
if (vk_descriptor_type_is_dynamic(set_layout->bindings[b].type)) {
layout->binding_translation[j].binding_class[b] = DZN_PIPELINE_BINDING_DYNAMIC_BUFFER;
if (device->bindless)
binding_trans[b] += dynamic_buffer_base;
@ -2449,7 +2442,7 @@ dzn_descriptor_update_template_create(struct dzn_device *device,
&ptr, false, device->bindless);
}
if (is_dynamic_desc_type(type)) {
if (vk_descriptor_type_is_dynamic(type)) {
entry->buffer_idx = dzn_descriptor_set_ptr_get_buffer_idx(set_layout, &ptr);
} else if (type != VK_DESCRIPTOR_TYPE_SAMPLER) {
if (is_buffer_desc_type_without_view(type))