return VK_SUCCESS;
}
-static VkResult
+VkResult
nvk_reset_cmd_buffer(struct nvk_cmd_buffer *cmd_buffer)
{
vk_command_buffer_reset(&cmd_buffer->vk);
+
+ nouveau_ws_push_reset(cmd_buffer->push);
+
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL
nvk_BeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo *pBeginInfo)
{
+ VK_FROM_HANDLE(nvk_cmd_buffer, cmd, commandBuffer);
+
+ if (pBeginInfo->flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT)
+ cmd->reset_on_submit = true;
+ else
+ cmd->reset_on_submit = false;
+
return VK_SUCCESS;
}
struct list_head pool_link;
struct nouveau_ws_push *push;
+ bool reset_on_submit;
};
+VkResult nvk_reset_cmd_buffer(struct nvk_cmd_buffer *cmd_buffer);
+
VK_DEFINE_HANDLE_CASTS(nvk_cmd_buffer, vk.base, VkCommandBuffer,
VK_OBJECT_TYPE_COMMAND_BUFFER)
VK_DEFINE_NONDISP_HANDLE_CASTS(nvk_cmd_pool, vk.base, VkCommandPool,
}
nouveau_ws_push_submit(cmd->push, device->pdev->dev, device->ctx);
+ if (cmd->reset_on_submit)
+ nvk_reset_cmd_buffer(cmd);
}
for (uint32_t i = 0; i < submission->signal_count; i++) {
util_dynarray_append(&push->bos, struct nouveau_ws_push_bo, push_bo);
}
+
+void nouveau_ws_push_reset(struct nouveau_ws_push *push)
+{
+ util_dynarray_clear(&push->bos);
+
+ nouveau_ws_push_ref(push, push->bo, NOUVEAU_WS_BO_RD);
+ push->map = push->orig_map;
+}
void nouveau_ws_push_destroy(struct nouveau_ws_push *);
int nouveau_ws_push_submit(struct nouveau_ws_push *, struct nouveau_ws_device *, struct nouveau_ws_context *);
void nouveau_ws_push_ref(struct nouveau_ws_push *, struct nouveau_ws_bo *, enum nouveau_ws_bo_map_flags);
+void nouveau_ws_push_reset(struct nouveau_ws_push *);
#ifdef CONFIG_NOUVEAU_DEBUG_PUSH
#define PUSH_PRINTF(p,f,a...) do { \