[vulkan] Add support for code-only render passes

Still very preliminary, but it allows for CPU-only passes to be added to
the tasks run for each frame.
This commit is contained in:
Bill Currie 2022-11-22 13:25:09 +09:00
parent b7947b48a5
commit 0a3417d38e
2 changed files with 19 additions and 0 deletions

View file

@ -64,6 +64,9 @@ qfv_renderpass_t *Vulkan_CreateRenderPass (struct vulkan_ctx_s *ctx,
const char *name,
struct qfv_output_s *output,
qfv_draw_t draw);
qfv_renderpass_t *Vulkan_CreateFunctionPass (struct vulkan_ctx_s *ctx,
const char *name,
qfv_draw_t function);
void Vulkan_DestroyRenderPass (struct vulkan_ctx_s *ctx,
qfv_renderpass_t *renderpass);
void Vulkan_CreateAttachments (struct vulkan_ctx_s *ctx,

View file

@ -290,6 +290,22 @@ Vulkan_CreateRenderPass (vulkan_ctx_t *ctx, const char *name,
return rp;
}
qfv_renderpass_t *
Vulkan_CreateFunctionPass (vulkan_ctx_t *ctx, const char *name,
qfv_draw_t function)
{
qfv_renderpass_t *rp = calloc (1, sizeof (qfv_renderpass_t));
rp->name = name;
rp->draw = function;
DARRAY_INIT (&rp->frames, 4);
DARRAY_RESIZE (&rp->frames, ctx->frames.size);
for (size_t i = 0; i < rp->frames.size; i++) {
init_renderframe (ctx, rp, &rp->frames.a[i]);
}
return rp;
}
void
Vulkan_DestroyRenderPass (vulkan_ctx_t *ctx, qfv_renderpass_t *renderpass)
{