[vulkan] Clean up pipeline def loading

This commit is contained in:
Bill Currie 2021-01-05 17:45:02 +09:00
parent 7c661e7cc5
commit d22be09ae3

View file

@ -260,22 +260,23 @@ static qfv_pipelinestagepair_t imageLayoutTransitionStages[] = {
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT }, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT },
}; };
static plitem_t * static void
qfv_load_pipeline (void) qfv_load_pipeline (vulkan_ctx_t *ctx)
{ {
static plitem_t *pipeline; if (!ctx->pipelineDef) {
ctx->pipelineDef = PL_GetPropertyList (quakeforge_pipeline);
if (!pipeline) { if (ctx->pipelineDef) {
pipeline = PL_GetPropertyList (quakeforge_pipeline); QFV_ParseResources (ctx, ctx->pipelineDef);
}
} }
return pipeline;
} }
void void
Vulkan_CreateRenderPass (vulkan_ctx_t *ctx) Vulkan_CreateRenderPass (vulkan_ctx_t *ctx)
{ {
plitem_t *item = qfv_load_pipeline (); qfv_load_pipeline (ctx);
plitem_t *item = ctx->pipelineDef;
if (!item || !(item = PL_ObjectForKey (item, "renderpass"))) { if (!item || !(item = PL_ObjectForKey (item, "renderpass"))) {
Sys_Printf ("error loading renderpass\n"); Sys_Printf ("error loading renderpass\n");
} else { } else {
@ -402,11 +403,6 @@ Vulkan_DestroyRenderPass (vulkan_ctx_t *ctx)
void void
Vulkan_CreatePipelines (vulkan_ctx_t *ctx) Vulkan_CreatePipelines (vulkan_ctx_t *ctx)
{ {
plitem_t *pipeline_def = qfv_load_pipeline ();
if (pipeline_def) {
QFV_ParseResources (ctx, pipeline_def);
}
} }
void void