tu: Fix TU_DRAW_STATE_VB size

vi_bindings_valid doesn't necessarily match the # of VBOs emitted,
resulting an invalid size in the CP_SET_DRAW_STATE packet.  Somehow
this didn't seem to cause problems prior to Dxx (although may
potentially have been a source of flakes, depending on what random
cmds followed in memory).  But caused hangs on Dxx.

See, for example, dEQP-VK.pipeline.fast_linked_library.vertex_input.misc.unused_binding

Fixes: 97da0a7734 ("tu: Rewrite to use common Vulkan dynamic state")
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39254>
This commit is contained in:
Rob Clark 2026-01-10 11:17:00 -08:00 committed by Marge Bot
parent 7b82b52fd7
commit 63243bcc3e
2 changed files with 2 additions and 9 deletions

View file

@ -222,7 +222,6 @@ KHR-GLES3.framebuffer_blit.multisampled_to_singlesampled_blit_depth_config_test,
# New fails in 1.4.3.3
dEQP-VK.memory.concurrent_access.shader_and_host,Fail
dEQP-VK.pipeline.fast_linked_library.vertex_input.misc.unused_binding_dynamic,Crash
dEQP-VK.pipeline.monolithic.vertex_input.misc.unused_binding_dynamic,Crash
dEQP-VK.transform_feedback.simple.draw_indirect_counter_offset_16,Fail
dEQP-VK.transform_feedback.simple.draw_indirect_counter_offset_244,Fail

View file

@ -4527,8 +4527,9 @@ tu_CmdBindVertexBuffers2(VkCommandBuffer commandBuffer,
pStrides);
}
cmd->state.vertex_buffers.size = 4 * cmd->state.max_vbs_bound;
cmd->state.vertex_buffers.iova =
tu_cs_draw_state(&cmd->sub_cs, &cs, 4 * cmd->state.max_vbs_bound).iova;
tu_cs_draw_state(&cmd->sub_cs, &cs, cmd->state.vertex_buffers.size).iova;
for (uint32_t i = 0; i < bindingCount; i++) {
if (pBuffers[i] == VK_NULL_HANDLE) {
@ -8171,13 +8172,6 @@ tu6_draw_common(struct tu_cmd_buffer *cmd,
}
}
if (BITSET_TEST(cmd->vk.dynamic_graphics_state.dirty,
MESA_VK_DYNAMIC_VI_BINDINGS_VALID)) {
cmd->state.vertex_buffers.size =
util_last_bit(cmd->vk.dynamic_graphics_state.vi_bindings_valid) * 4;
dirty |= TU_CMD_DIRTY_VERTEX_BUFFERS;
}
if (dirty & TU_CMD_DIRTY_SHADER_CONSTS)
cmd->state.shader_const = tu_emit_consts(cmd, false);