mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-08 02:12:17 +00:00
[vulkan] Support disabling pipelines
This is useful for selecting post-processing pipelines at run-time.
This commit is contained in:
parent
fc949de24f
commit
25dfa75505
4 changed files with 10 additions and 0 deletions
|
@ -166,6 +166,7 @@ typedef struct qfv_attachmentsetinfo_s {
|
|||
typedef struct qfv_pipelineinfo_s {
|
||||
vec4f_t color;
|
||||
const char *name;
|
||||
bool disabled;
|
||||
uint32_t num_tasks;
|
||||
qfv_taskinfo_t *tasks;
|
||||
|
||||
|
@ -309,6 +310,7 @@ typedef struct qfv_label_s {
|
|||
|
||||
typedef struct qfv_pipeline_s {
|
||||
qfv_label_t label;
|
||||
bool disabled;
|
||||
VkPipelineBindPoint bindPoint;
|
||||
vec4u_t dispatch;
|
||||
VkPipeline pipeline;
|
||||
|
|
|
@ -81,6 +81,9 @@ run_tasks (uint32_t task_count, qfv_taskinfo_t *tasks, qfv_taskctx_t *ctx)
|
|||
static void
|
||||
run_pipeline (qfv_pipeline_t *pipeline, qfv_taskctx_t *taskctx)
|
||||
{
|
||||
if (pipeline->disabled) {
|
||||
return;
|
||||
}
|
||||
qfv_device_t *device = taskctx->ctx->device;
|
||||
qfv_devfuncs_t *dfunc = device->funcs;
|
||||
auto cmd = taskctx->cmd;
|
||||
|
@ -158,6 +161,9 @@ static void
|
|||
run_compute_pipeline (qfv_pipeline_t *pipeline, VkCommandBuffer cmd,
|
||||
vulkan_ctx_t *ctx)
|
||||
{
|
||||
if (pipeline->disabled) {
|
||||
return;
|
||||
}
|
||||
qfv_device_t *device = ctx->device;
|
||||
qfv_devfuncs_t *dfunc = device->funcs;
|
||||
dfunc->vkCmdBindPipeline (cmd, pipeline->bindPoint, pipeline->pipeline);
|
||||
|
|
|
@ -753,6 +753,7 @@ init_pipeline (qfv_pipeline_t *pl, qfv_pipelineinfo_t *plinfo,
|
|||
.name = plinfo->name,
|
||||
.color = plinfo->color,
|
||||
},
|
||||
.disabled = plinfo->disabled,
|
||||
.bindPoint = is_compute ? VK_PIPELINE_BIND_POINT_COMPUTE
|
||||
: VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
.pipeline = is_compute ? s->ptr.cpl[s->inds.num_comp_pipelines]
|
||||
|
|
|
@ -327,6 +327,7 @@ parse = {
|
|||
type = string;
|
||||
string = name;
|
||||
};
|
||||
disabled = auto;
|
||||
tasks = {
|
||||
type = (array, qfv_taskinfo_t);
|
||||
size = num_tasks;
|
||||
|
|
Loading…
Reference in a new issue