dzn: Only bind descriptor sets up to the used amount of the current layout

Prevents setting a root SRV into a slot that's not declared as an SRV
in the root signature if a set is bound into a higher slot from a previous
draw/dispatch op.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
This commit is contained in:
Jesse Natalie
2023-03-23 08:33:18 -07:00
committed by Marge Bot
parent a227ef2983
commit 35a789dbb7
+2 -2
View File
@@ -3106,7 +3106,7 @@ dzn_cmd_buffer_update_heaps(struct dzn_cmd_buffer *cmdbuf, uint32_t bindpoint)
new_heap_offsets[type] = dst_heap_offset;
update_root_desc_table[type] = true;
for (uint32_t s = 0; s < MAX_SETS; s++) {
for (uint32_t s = 0; s < cmdbuf->state.pipeline->root.sets_param_count; s++) {
const struct dzn_descriptor_set *set = desc_state->sets[s].set;
if (!set) continue;
@@ -3175,7 +3175,7 @@ dzn_cmd_buffer_update_heaps(struct dzn_cmd_buffer *cmdbuf, uint32_t bindpoint)
}
if (device->bindless) {
for (uint32_t s = 0; s < MAX_SETS; ++s) {
for (uint32_t s = 0; s < pipeline->root.sets_param_count; ++s) {
const struct dzn_descriptor_set *set = desc_state->sets[s].set;
if (!set || !set->pool->bindless.buf)
continue;