diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index abafd7663d5..bbd2dd25492 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -339,7 +339,8 @@ radv_destroy_cmd_buffer(struct vk_command_buffer *vk_cmd_buffer) } static VkResult -radv_create_cmd_buffer(struct vk_command_pool *pool, struct vk_command_buffer **cmd_buffer_out) +radv_create_cmd_buffer(struct vk_command_pool *pool, VkCommandBufferLevel level, + struct vk_command_buffer **cmd_buffer_out) { struct radv_device *device = container_of(pool->base.device, struct radv_device, vk); const struct radv_physical_device *pdev = radv_device_physical(device); @@ -349,7 +350,7 @@ radv_create_cmd_buffer(struct vk_command_pool *pool, struct vk_command_buffer ** if (cmd_buffer == NULL) return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY); - VkResult result = vk_command_buffer_init(pool, &cmd_buffer->vk, &radv_cmd_buffer_ops, 0); + VkResult result = vk_command_buffer_init(pool, &cmd_buffer->vk, &radv_cmd_buffer_ops, level); if (result != VK_SUCCESS) { vk_free(&cmd_buffer->vk.pool->alloc, cmd_buffer); return result; diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index 7b49a7aadec..df169b75282 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -91,7 +91,7 @@ cmd_buffer_init(struct v3dv_cmd_buffer *cmd_buffer, } static VkResult -cmd_buffer_create(struct vk_command_pool *pool, +cmd_buffer_create(struct vk_command_pool *pool, VkCommandBufferLevel level, struct vk_command_buffer **cmd_buffer_out) { struct v3dv_device *device = @@ -111,7 +111,7 @@ cmd_buffer_create(struct vk_command_pool *pool, */ VkResult result; result = vk_command_buffer_init(pool, &cmd_buffer->vk, - &v3dv_cmd_buffer_ops, 0 /* level */); + &v3dv_cmd_buffer_ops, level); if (result != VK_SUCCESS) { vk_free(&pool->alloc, cmd_buffer); return result; diff --git a/src/freedreno/vulkan/tu_cmd_buffer.cc b/src/freedreno/vulkan/tu_cmd_buffer.cc index fd62b06d918..850603a5e7b 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.cc +++ b/src/freedreno/vulkan/tu_cmd_buffer.cc @@ -2106,6 +2106,7 @@ static void tu_reset_render_pass(struct tu_cmd_buffer *cmd_buffer) static VkResult tu_create_cmd_buffer(struct vk_command_pool *pool, + VkCommandBufferLevel level, struct vk_command_buffer **cmd_buffer_out) { struct tu_device *device = @@ -2119,9 +2120,8 @@ tu_create_cmd_buffer(struct vk_command_pool *pool, if (cmd_buffer == NULL) return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY); - VkResult result = - vk_command_buffer_init(pool, &cmd_buffer->vk, &tu_cmd_buffer_ops, - VK_COMMAND_BUFFER_LEVEL_PRIMARY); + VkResult result = vk_command_buffer_init(pool, &cmd_buffer->vk, + &tu_cmd_buffer_ops, level); if (result != VK_SUCCESS) { vk_free2(&device->vk.alloc, NULL, cmd_buffer); return result; diff --git a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c index 89d7c797e27..8ffb461205e 100644 --- a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c +++ b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c @@ -36,6 +36,7 @@ lvp_cmd_buffer_destroy(struct vk_command_buffer *cmd_buffer) static VkResult lvp_create_cmd_buffer(struct vk_command_pool *pool, + VkCommandBufferLevel level, struct vk_command_buffer **cmd_buffer_out) { struct lvp_device *device = @@ -48,7 +49,7 @@ lvp_create_cmd_buffer(struct vk_command_pool *pool, return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY); VkResult result = vk_command_buffer_init(pool, &cmd_buffer->vk, - &lvp_cmd_buffer_ops, 0); + &lvp_cmd_buffer_ops, level); if (result != VK_SUCCESS) { vk_free(&pool->alloc, cmd_buffer); return result; diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 68d05eb74b2..a37af9ab25b 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -97,7 +97,7 @@ anv_cmd_buffer_ensure_rcs_companion(struct anv_cmd_buffer *cmd_buffer) assert(pool != NULL); struct vk_command_buffer *tmp_cmd_buffer = NULL; - result = pool->command_buffer_ops->create(pool, &tmp_cmd_buffer); + result = pool->command_buffer_ops->create(pool, cmd_buffer->vk.level, &tmp_cmd_buffer); if (result != VK_SUCCESS) goto unlock_and_return; @@ -114,6 +114,7 @@ unlock_and_return: static VkResult anv_create_cmd_buffer(struct vk_command_pool *pool, + VkCommandBufferLevel level, struct vk_command_buffer **cmd_buffer_out) { struct anv_device *device = @@ -127,7 +128,7 @@ anv_create_cmd_buffer(struct vk_command_pool *pool, return vk_error(pool, VK_ERROR_OUT_OF_HOST_MEMORY); result = vk_command_buffer_init(pool, &cmd_buffer->vk, - &anv_cmd_buffer_ops, 0); + &anv_cmd_buffer_ops, level); if (result != VK_SUCCESS) goto fail_alloc; diff --git a/src/intel/vulkan_hasvk/anv_cmd_buffer.c b/src/intel/vulkan_hasvk/anv_cmd_buffer.c index 40635699e25..52e944f92a9 100644 --- a/src/intel/vulkan_hasvk/anv_cmd_buffer.c +++ b/src/intel/vulkan_hasvk/anv_cmd_buffer.c @@ -84,6 +84,7 @@ anv_cmd_state_reset(struct anv_cmd_buffer *cmd_buffer) static VkResult anv_create_cmd_buffer(struct vk_command_pool *pool, + VkCommandBufferLevel level, struct vk_command_buffer **cmd_buffer_out) { struct anv_device *device = @@ -97,7 +98,7 @@ anv_create_cmd_buffer(struct vk_command_pool *pool, return vk_error(pool, VK_ERROR_OUT_OF_HOST_MEMORY); result = vk_command_buffer_init(pool, &cmd_buffer->vk, - &anv_cmd_buffer_ops, 0); + &anv_cmd_buffer_ops, level); if (result != VK_SUCCESS) goto fail_alloc; diff --git a/src/nouveau/vulkan/nvk_cmd_buffer.c b/src/nouveau/vulkan/nvk_cmd_buffer.c index df8eb6c40bf..60db6fd21d6 100644 --- a/src/nouveau/vulkan/nvk_cmd_buffer.c +++ b/src/nouveau/vulkan/nvk_cmd_buffer.c @@ -59,6 +59,7 @@ nvk_destroy_cmd_buffer(struct vk_command_buffer *vk_cmd_buffer) static VkResult nvk_create_cmd_buffer(struct vk_command_pool *vk_pool, + VkCommandBufferLevel level, struct vk_command_buffer **cmd_buffer_out) { struct nvk_cmd_pool *pool = container_of(vk_pool, struct nvk_cmd_pool, vk); @@ -72,7 +73,7 @@ nvk_create_cmd_buffer(struct vk_command_pool *vk_pool, return vk_error(dev, VK_ERROR_OUT_OF_HOST_MEMORY); result = vk_command_buffer_init(&pool->vk, &cmd->vk, - &nvk_cmd_buffer_ops, 0); + &nvk_cmd_buffer_ops, level); if (result != VK_SUCCESS) { vk_free(&pool->vk.alloc, cmd); return result; diff --git a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c index 0d93e73f170..b61d2142e11 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c @@ -1660,7 +1660,7 @@ panvk_destroy_cmdbuf(struct vk_command_buffer *vk_cmdbuf) } static VkResult -panvk_create_cmdbuf(struct vk_command_pool *vk_pool, +panvk_create_cmdbuf(struct vk_command_pool *vk_pool, VkCommandBufferLevel level, struct vk_command_buffer **cmdbuf_out) { struct panvk_device *device = @@ -1674,8 +1674,8 @@ panvk_create_cmdbuf(struct vk_command_pool *vk_pool, if (!cmdbuf) return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY); - VkResult result = vk_command_buffer_init(&pool->vk, &cmdbuf->vk, - &panvk_per_arch(cmd_buffer_ops), 0); + VkResult result = vk_command_buffer_init( + &pool->vk, &cmdbuf->vk, &panvk_per_arch(cmd_buffer_ops), level); if (result != VK_SUCCESS) { vk_free(&device->vk.alloc, cmdbuf); return result; diff --git a/src/vulkan/runtime/vk_command_buffer.h b/src/vulkan/runtime/vk_command_buffer.h index 6ae637ca5ab..5ff51bbf578 100644 --- a/src/vulkan/runtime/vk_command_buffer.h +++ b/src/vulkan/runtime/vk_command_buffer.h @@ -70,7 +70,7 @@ struct vk_command_buffer_ops { * set by `vk_common_AllocateCommandBuffers()` and the driver must not rely * on it until `vkBeginCommandBuffer()` time. */ - VkResult (*create)(struct vk_command_pool *, + VkResult (*create)(struct vk_command_pool *, VkCommandBufferLevel, struct vk_command_buffer **); /** Resets the command buffer diff --git a/src/vulkan/runtime/vk_command_pool.c b/src/vulkan/runtime/vk_command_pool.c index b4de2a82d96..4481a52da80 100644 --- a/src/vulkan/runtime/vk_command_pool.c +++ b/src/vulkan/runtime/vk_command_pool.c @@ -203,7 +203,7 @@ vk_common_AllocateCommandBuffers(VkDevice device, for (i = 0; i < pAllocateInfo->commandBufferCount; i++) { struct vk_command_buffer *cmd_buffer = vk_command_pool_find_free(pool); if (cmd_buffer == NULL) { - result = pool->command_buffer_ops->create(pool, &cmd_buffer); + result = pool->command_buffer_ops->create(pool, pAllocateInfo->level, &cmd_buffer); if (unlikely(result != VK_SUCCESS)) goto fail; }