mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
dzn: Skip binding entries with zero descriptors
D3D12 doesn't like empty descriptor ranges, so let's skip those at set layout creation time. Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15884>
This commit is contained in:
parent
b62087e069
commit
3becb2729a
1 changed files with 8 additions and 2 deletions
|
|
@ -134,6 +134,11 @@ dzn_descriptor_set_layout_create(dzn_device *device,
|
|||
uint32_t range_count[MAX_SHADER_VISIBILITIES][NUM_POOL_TYPES] = {};
|
||||
|
||||
for (uint32_t i = 0; i < pCreateInfo->bindingCount; i++) {
|
||||
binding_count = MAX2(binding_count, bindings[i].binding + 1);
|
||||
|
||||
if (!bindings[i].descriptorCount)
|
||||
continue;
|
||||
|
||||
D3D12_SHADER_VISIBILITY visibility =
|
||||
translate_desc_visibility(bindings[i].stageFlags);
|
||||
VkDescriptorType desc_type = bindings[i].descriptorType;
|
||||
|
|
@ -189,8 +194,6 @@ dzn_descriptor_set_layout_create(dzn_device *device,
|
|||
dynamic_ranges_offset += bindings[i].descriptorCount * factor;
|
||||
}
|
||||
}
|
||||
|
||||
binding_count = MAX2(binding_count, bindings[i].binding + 1);
|
||||
}
|
||||
|
||||
/* We need to allocate decriptor set layouts off the device allocator
|
||||
|
|
@ -321,6 +324,9 @@ dzn_descriptor_set_layout_create(dzn_device *device,
|
|||
assert(dynamic_buffer_idx <= MAX_DYNAMIC_BUFFERS);
|
||||
}
|
||||
|
||||
if (!ordered_bindings[i].descriptorCount)
|
||||
continue;
|
||||
|
||||
unsigned num_descs =
|
||||
num_descs_for_type(desc_type, has_static_sampler);
|
||||
if (!num_descs) continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue