[vulkan] Pass the current command buffer to tasks

Compute and render tasks need to be able to submit commands.
This commit is contained in:
Bill Currie 2023-06-16 22:34:08 +09:00
parent b0d1c0e75b
commit 274e821c06
2 changed files with 3 additions and 0 deletions

View file

@ -381,6 +381,7 @@ typedef struct qfv_renderctx_s {
typedef struct qfv_taskctx_s {
struct vulkan_ctx_s *ctx;
qfv_pipeline_t *pipeline;
VkCommandBuffer cmd;
} qfv_taskctx_t;
VkCommandBuffer QFV_GetCmdBufffer (struct vulkan_ctx_s *ctx, bool secondary);

View file

@ -99,6 +99,7 @@ run_pipeline (qfv_pipeline_t *pipeline, VkCommandBuffer cmd, vulkan_ctx_t *ctx)
qfv_taskctx_t taskctx = {
.ctx = ctx,
.pipeline = pipeline,
.cmd = cmd,
};
run_tasks (pipeline->task_count, pipeline->tasks, &taskctx);
@ -187,6 +188,7 @@ run_compute_pipeline (qfv_pipeline_t *pipeline, VkCommandBuffer cmd,
qfv_taskctx_t taskctx = {
.ctx = ctx,
.pipeline = pipeline,
.cmd = cmd,
};
run_tasks (pipeline->task_count, pipeline->tasks, &taskctx);