From 379617b77de7f4ef72e4e1d6309d4543b47693b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 15 Aug 2025 12:13:53 -0700 Subject: [PATCH] anv: Define bt_block only in the block that uses it in anv_cmd_buffer_alloc_binding_table() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_batch_chain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 5a22c3caeaf..08c8b10d9bd 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -706,8 +706,6 @@ anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer, if (u_vector_length(&cmd_buffer->bt_block_states) == 0) return (struct anv_state) { 0 }; - struct anv_state *bt_block = u_vector_head(&cmd_buffer->bt_block_states); - uint32_t bt_size = align(entries * 4, 32); struct anv_state state = cmd_buffer->bt_next; @@ -726,6 +724,8 @@ anv_cmd_buffer_alloc_binding_table(struct anv_cmd_buffer *cmd_buffer, */ *state_offset = 0; } else { + struct anv_state *bt_block = u_vector_head(&cmd_buffer->bt_block_states); + assert(bt_block->offset < 0); *state_offset = -bt_block->offset; }