mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 19:30:11 +01:00
pvr: factor out write_immutable_samplers
This is the only part of pvr_descriptor_set_create() that actually depends on architecture specific details (in particular, the write_sampler calls), so let's factor this out to a separate function. This is going to be helpful when we're doing multi-arch support. Reviewed-by: Ashish Chauhan <ashish.chauhan@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38423>
This commit is contained in:
parent
afff4be21c
commit
da414f102c
1 changed files with 18 additions and 11 deletions
|
|
@ -400,6 +400,23 @@ write_sampler(const struct pvr_descriptor_set *set,
|
|||
const struct pvr_descriptor_set_layout_binding *binding,
|
||||
uint32_t elem);
|
||||
|
||||
static void
|
||||
write_immutable_samplers(struct pvr_descriptor_set_layout *layout,
|
||||
struct pvr_descriptor_set *set)
|
||||
{
|
||||
for (unsigned u = 0; u < layout->binding_count; ++u) {
|
||||
const struct pvr_descriptor_set_layout_binding *binding =
|
||||
&layout->bindings[u];
|
||||
|
||||
if (binding->type == VK_DESCRIPTOR_TYPE_SAMPLER &&
|
||||
binding->immutable_samplers) {
|
||||
for (uint32_t j = 0; j < binding->descriptor_count; j++) {
|
||||
write_sampler(set, NULL, binding, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static VkResult
|
||||
pvr_descriptor_set_create(struct pvr_device *device,
|
||||
struct pvr_descriptor_pool *pool,
|
||||
|
|
@ -437,17 +454,7 @@ pvr_descriptor_set_create(struct pvr_device *device,
|
|||
list_addtail(&set->link, &pool->desc_sets);
|
||||
|
||||
/* Setup immutable samplers. */
|
||||
for (unsigned u = 0; u < layout->binding_count; ++u) {
|
||||
const struct pvr_descriptor_set_layout_binding *binding =
|
||||
&layout->bindings[u];
|
||||
|
||||
if (binding->type == VK_DESCRIPTOR_TYPE_SAMPLER &&
|
||||
binding->immutable_samplers) {
|
||||
for (uint32_t j = 0; j < binding->descriptor_count; j++) {
|
||||
write_sampler(set, NULL, binding, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
write_immutable_samplers(layout, set);
|
||||
|
||||
*descriptor_set_out = set;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue