anv: mismatch in descriptor layout support vs functionality
I might be missing something, but it seems like this mechanism is broken:
-
anv_descriptor_requires_bindless()
returns true if any of the included flags are set
static const VkDescriptorBindingFlagBitsEXT flags_requiring_bindless =
VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT_EXT |
VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT_EXT |
VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT;
-
anv_descriptor_supports_bindless()
returns false unconditionally for buffer-type descriptors -
anv_GetDescriptorSetLayoutSupport()
doesn't check any of this, so a set using these flags with buffer-type descriptors is supported, it gets created/bound/updated fine, and then asserts at the following part ofanv_nir_apply_pipeline_layout.c
around L1270
if (binding->data & ANV_DESCRIPTOR_SURFACE_STATE) {
if (map->surface_count + array_size > MAX_BINDING_TABLE_SIZE ||
anv_descriptor_requires_bindless(pdevice, binding, false)) {
/* If this descriptor doesn't fit in the binding table or if it
* requires bindless for some reason, flag it as bindless.
*/
assert(anv_descriptor_supports_bindless(pdevice, binding, false));