[vulkan] Allow process steps to have render or compute

If a step has process tasks, any render or compute
pipelines/renderpasses are **not** run automatically: the idea is the
process tasks need to run the relevant pipelines in a custom manner but
needs the objects to be created.
This commit is contained in:
Bill Currie 2023-07-24 10:07:57 +09:00
parent 31cf3ed248
commit 2fa44c03a6
2 changed files with 16 additions and 9 deletions

View file

@ -238,11 +238,16 @@ QFV_RunRenderJob (vulkan_ctx_t *ctx)
for (uint32_t i = 0; i < job->num_steps; i++) { for (uint32_t i = 0; i < job->num_steps; i++) {
int64_t step_start = Sys_LongTime (); int64_t step_start = Sys_LongTime ();
__auto_type step = &job->steps[i]; __auto_type step = &job->steps[i];
if (step->render) { if (!step->process) {
run_renderpass (step->render->active, ctx); // run render and compute steps automatically only if there's no
} // process for the step (the idea is the proces uses the compute
if (step->compute) { // and renderpass objects for its own purposes).
run_compute (step->compute, ctx, step); if (step->render) {
run_renderpass (step->render->active, ctx);
}
if (step->compute) {
run_compute (step->compute, ctx, step);
}
} }
if (step->process) { if (step->process) {
run_process (step->process, ctx); run_process (step->process, ctx);

View file

@ -183,12 +183,14 @@ count_comp_stuff (qfv_computeinfo_t *ci, objcount_t *counts)
static void static void
count_step_stuff (qfv_stepinfo_t *step, objcount_t *counts) count_step_stuff (qfv_stepinfo_t *step, objcount_t *counts)
{ {
if ((step->render && step->compute) if (step->render && step->compute && !step->process) {
|| (step->render && step->process) Sys_Error ("%s: invalid step: must have process for render+compute",
|| (step->compute && step->process)) {
Sys_Error ("%s: invalid step: must be one of render/compute/process",
step->name); step->name);
} }
if (!step->render && !step->compute && !step->process) {
Sys_Error ("%s: invalid step: must have at least one of "
"proces/render/compute", step->name);
}
if (step->render) { if (step->render) {
__auto_type rinfo = step->render; __auto_type rinfo = step->render;
counts->num_renderpasses += rinfo->num_renderpasses; counts->num_renderpasses += rinfo->num_renderpasses;