mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
pvr: use vk_descriptor_type_is_dynamic
No need to open-code this one now that we have a generic helper. 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:
parent
8628f31f49
commit
6877ff7d9b
2 changed files with 14 additions and 28 deletions
|
|
@ -3776,8 +3776,7 @@ static uint16_t pvr_get_dynamic_descriptor_primary_offset(
|
|||
struct pvr_descriptor_size_info size_info;
|
||||
uint32_t offset;
|
||||
|
||||
assert(binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC);
|
||||
assert(vk_descriptor_type_is_dynamic(binding->type));
|
||||
assert(desc_idx < binding->descriptor_count);
|
||||
|
||||
pvr_descriptor_size_info_init(device, binding->type, &size_info);
|
||||
|
|
@ -3806,8 +3805,7 @@ static uint16_t pvr_get_dynamic_descriptor_secondary_offset(
|
|||
struct pvr_descriptor_size_info size_info;
|
||||
uint32_t offset;
|
||||
|
||||
assert(binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC);
|
||||
assert(vk_descriptor_type_is_dynamic(binding->type));
|
||||
assert(desc_idx < binding->descriptor_count);
|
||||
|
||||
pvr_descriptor_size_info_init(device, binding->type, &size_info);
|
||||
|
|
|
|||
|
|
@ -358,8 +358,7 @@ pvr_dump_in_memory_layout_sizes(const struct pvr_descriptor_set_layout *layout)
|
|||
const struct pvr_descriptor_set_layout_binding *const binding =
|
||||
&layout->bindings[i];
|
||||
|
||||
if (binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| %s %04u | %-26s[%3u] |",
|
||||
|
|
@ -374,8 +373,7 @@ pvr_dump_in_memory_layout_sizes(const struct pvr_descriptor_set_layout *layout)
|
|||
const struct pvr_descriptor_set_layout_binding *const binding =
|
||||
&layout->bindings[i];
|
||||
|
||||
if (binding->type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC &&
|
||||
binding->type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (!vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| * %s %04u | %-26s[%3u] |",
|
||||
|
|
@ -397,8 +395,7 @@ pvr_dump_in_memory_layout_sizes(const struct pvr_descriptor_set_layout *layout)
|
|||
const struct pvr_descriptor_set_layout_binding *const binding =
|
||||
&layout->bindings[i];
|
||||
|
||||
if (binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| %s %04u | %-26s[%3u] |",
|
||||
|
|
@ -413,8 +410,7 @@ pvr_dump_in_memory_layout_sizes(const struct pvr_descriptor_set_layout *layout)
|
|||
const struct pvr_descriptor_set_layout_binding *const binding =
|
||||
&layout->bindings[i];
|
||||
|
||||
if (binding->type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC &&
|
||||
binding->type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (!vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| * %s %04u | %-26s[%3u] |",
|
||||
|
|
@ -589,8 +585,7 @@ VkResult pvr_CreateDescriptorSetLayout(
|
|||
* Having them all in one place makes updating them easier when the
|
||||
* user updates the dynamic offsets.
|
||||
*/
|
||||
if (descriptor_type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC &&
|
||||
descriptor_type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) {
|
||||
if (!vk_descriptor_type_is_dynamic(descriptor_type)) {
|
||||
struct pvr_descriptor_size_info size_info;
|
||||
|
||||
pvr_descriptor_size_info_init(device, descriptor_type, &size_info);
|
||||
|
|
@ -627,8 +622,7 @@ VkResult pvr_CreateDescriptorSetLayout(
|
|||
&layout->bindings[bind_num];
|
||||
const VkDescriptorType descriptor_type = internal_binding->type;
|
||||
|
||||
if (descriptor_type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC &&
|
||||
descriptor_type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (!vk_descriptor_type_is_dynamic(descriptor_type))
|
||||
continue;
|
||||
|
||||
for (uint32_t stage = 0;
|
||||
|
|
@ -715,8 +709,7 @@ pvr_dump_in_register_layout_sizes(const struct pvr_device *device,
|
|||
if (!(binding->shader_stage_mask & BITFIELD_BIT(stage)))
|
||||
continue;
|
||||
|
||||
if (binding->type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC &&
|
||||
binding->type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (!vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| +%04u | set = %u, binding = %03u | %-26s[%3u] |",
|
||||
|
|
@ -756,8 +749,7 @@ pvr_dump_in_register_layout_sizes(const struct pvr_device *device,
|
|||
if (!(binding->shader_stage_mask & BITFIELD_BIT(stage)))
|
||||
continue;
|
||||
|
||||
if (binding->type != VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC &&
|
||||
binding->type != VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (!vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| +%04u | set = %u, binding = %03u | %-26s[%3u] |",
|
||||
|
|
@ -793,8 +785,7 @@ pvr_dump_in_register_layout_sizes(const struct pvr_device *device,
|
|||
if (!(binding->shader_stage_mask & BITFIELD_BIT(stage)))
|
||||
continue;
|
||||
|
||||
if (binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| +%04u | set = %u, binding = %03u | %-26s[%3u] |",
|
||||
|
|
@ -828,8 +819,7 @@ pvr_dump_in_register_layout_sizes(const struct pvr_device *device,
|
|||
if (!(binding->shader_stage_mask & BITFIELD_BIT(stage)))
|
||||
continue;
|
||||
|
||||
if (binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
|
||||
if (vk_descriptor_type_is_dynamic(binding->type))
|
||||
continue;
|
||||
|
||||
mesa_logd("| +%04u | set = %u, binding = %03u | %-26s[%3u] |",
|
||||
|
|
@ -1344,8 +1334,7 @@ static void pvr_descriptor_update_buffer_info(
|
|||
struct pvr_descriptor_size_info size_info;
|
||||
bool is_dynamic;
|
||||
|
||||
is_dynamic = (binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) ||
|
||||
(binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC);
|
||||
is_dynamic = vk_descriptor_type_is_dynamic(binding->type);
|
||||
|
||||
pvr_descriptor_size_info_init(device, binding->type, &size_info);
|
||||
|
||||
|
|
@ -1956,8 +1945,7 @@ static void pvr_copy_descriptor_set(struct pvr_device *device,
|
|||
* set memory. They only exist in the set->descriptors list which we've
|
||||
* already updated above.
|
||||
*/
|
||||
if (src_binding->type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC ||
|
||||
src_binding->type == VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC) {
|
||||
if (vk_descriptor_type_is_dynamic(src_binding->type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue