mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
radv: remove unnecessary check in FreeCommandBuffers()
cmd_buffer->pool should never be NULL. Even if AllocateCommandBuffers()
fails, the successfully created cmdbuffers would have it set correctly.
From the Vulkan spec:
"VUID-vkFreeCommandBuffers-pCommandBuffers-parent
Each element of pCommandBuffers that is a valid handle must have
been created, allocated, or retrieved from commandPool."
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15164>
This commit is contained in:
parent
01ec899083
commit
c6d776f092
1 changed files with 8 additions and 7 deletions
|
|
@ -4435,16 +4435,17 @@ VKAPI_ATTR void VKAPI_CALL
|
|||
radv_FreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount,
|
||||
const VkCommandBuffer *pCommandBuffers)
|
||||
{
|
||||
RADV_FROM_HANDLE(radv_cmd_pool, pool, commandPool);
|
||||
|
||||
for (uint32_t i = 0; i < commandBufferCount; i++) {
|
||||
RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, pCommandBuffers[i]);
|
||||
|
||||
if (cmd_buffer) {
|
||||
if (cmd_buffer->pool) {
|
||||
list_del(&cmd_buffer->pool_link);
|
||||
list_addtail(&cmd_buffer->pool_link, &cmd_buffer->pool->free_cmd_buffers);
|
||||
} else
|
||||
radv_destroy_cmd_buffer(cmd_buffer);
|
||||
}
|
||||
if (!cmd_buffer)
|
||||
continue;
|
||||
assert(cmd_buffer->pool == pool);
|
||||
|
||||
list_del(&cmd_buffer->pool_link);
|
||||
list_addtail(&cmd_buffer->pool_link, &pool->free_cmd_buffers);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue