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>
(cherry picked from commit 63243bcc3e)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
This commit is contained in:
Rob Clark 2026-01-10 11:17:00 -08:00 committed by Dylan Baker
parent 043544961c
commit 6a5d21de3f
4 changed files with 3 additions and 12 deletions

View file

@ -414,7 +414,7 @@
"description": "tu: Fix TU_DRAW_STATE_VB size",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "97da0a7734188f4b666bc38833bfadc8b4c53f84",
"notes": null

View file

@ -231,8 +231,6 @@ wayland-dEQP-EGL.functional.image.modify.tex_rgb5_a1_renderbuffer_clear_color,Fa
# 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
dEQP-VK.transform_feedback.simple.draw_indirect_counter_offset_508,Fail

View file

@ -21,7 +21,6 @@ gmem-dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.uniform_32struct_
# 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
dEQP-VK.transform_feedback.simple.draw_indirect_counter_offset_508,Fail

View file

@ -3725,8 +3725,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) {
@ -7028,13 +7029,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);