[vulkan] Support parsing pipeline layout info

This is for the new system.
This commit is contained in:
Bill Currie 2023-02-27 02:54:51 +09:00
parent acf828baa3
commit 918237507e
3 changed files with 55 additions and 4 deletions

View file

@ -2336,3 +2336,39 @@ QFV_ParseRenderInfo (vulkan_ctx_t *ctx, plitem_t *item, qfv_renderctx_t *rctx)
return ri; return ri;
} }
int
QFV_ParseLayoutInfo (vulkan_ctx_t *ctx, memsuper_t *memsuper,
exprtab_t *symtab, const char *ref,
qfv_layoutinfo_t *layout)
{
*layout = (qfv_layoutinfo_t) {};
scriptctx_t *sctx = ctx->script_context;
plitem_t *messages = PL_NewArray ();
exprctx_t exprctx = {
.symtab = &root_symtab,
.messages = messages,
.hashctx = &sctx->hashctx,
.memsuper = memsuper,
.external_variables = symtab,
};
parsectx_t parsectx = {
.ectx = &exprctx,
.vctx = ctx,
};
plitem_t *item = PL_NewString (ref);
int ret;
if (!(ret = parse_qfv_layoutinfo_t (0, item, layout, messages,
&parsectx))) {
for (int i = 0; i < PL_A_NumObjects (messages); i++) {
Sys_Printf ("%s\n", PL_String (PL_ObjectAtIndex (messages, i)));
}
}
PL_Free (messages);
PL_Free (item);
return ret;
}

View file

@ -86,4 +86,8 @@ struct qfv_renderctx_s;
struct qfv_renderinfo_s *QFV_ParseRenderInfo (vulkan_ctx_t *ctx, struct qfv_renderinfo_s *QFV_ParseRenderInfo (vulkan_ctx_t *ctx,
plitem_t *item, plitem_t *item,
struct qfv_renderctx_s *rctx); struct qfv_renderctx_s *rctx);
struct memsuper_s;
int QFV_ParseLayoutInfo (vulkan_ctx_t *ctx, struct memsuper_s *memsuper,
exprtab_t *symtab, const char *ref,
qfv_layoutinfo_t *layout);
#endif//__vkparse_h #endif//__vkparse_h

View file

@ -42,6 +42,7 @@
qfv_attachmentrefinfo_t, qfv_attachmentrefinfo_t,
qfv_attachmentsetinfo_t, qfv_attachmentsetinfo_t,
qfv_taskinfo_t, qfv_taskinfo_t,
qfv_layoutinfo_t,
qfv_pipelineinfo_t, qfv_pipelineinfo_t,
qfv_subpassinfo_t, qfv_subpassinfo_t,
qfv_framebufferinfo_t, qfv_framebufferinfo_t,
@ -480,6 +481,19 @@
values = preserve; values = preserve;
}; };
}; };
qfv_layoutinfo_s = {
.name = qfv_layoutinfo_t;
descriptorSets = {
type = (array, qfv_reference_t);
size = num_sets;
values = sets;
};
pushConstantRanges = {
type = (array, VkPushConstantRange);
size = num_ranges;
values = ranges;
};
};
qfv_pipelineinfo_s = { qfv_pipelineinfo_s = {
.name = qfv_pipelineinfo_t; .name = qfv_pipelineinfo_t;
color = auto; color = auto;
@ -535,10 +549,7 @@
type = (single, VkPipelineDynamicStateCreateInfo); type = (single, VkPipelineDynamicStateCreateInfo);
value = dynamic; value = dynamic;
}; };
layout = { layout = auto;
type = (single, qfv_reference_t);
value = layout;
};
}; };
qfv_subpassinfo_s = { qfv_subpassinfo_s = {
.name = qfv_subpassinfo_t; .name = qfv_subpassinfo_t;