[vulkan] Provide access to swapchain image count

This necessitated hand-writing qfv_swapchain_t's descriptors as I don't
feel like getting that complicated with vkgen at this stage and it's not
really appropriate anyway? qfv_swapchain_t is meant to be read-only and
not parsed from a plist.
This commit is contained in:
Bill Currie 2021-01-10 01:38:31 +09:00
parent 16334158bd
commit e281b608e1
2 changed files with 32 additions and 5 deletions

View file

@ -469,6 +469,36 @@ parse_BasePipeline (const plitem_t *item, void **data,
#include "libs/video/renderer/vulkan/vkparse.cinc"
static exprsym_t imageset_symbols[] = {
{"size", &cexpr_size_t, (void *)field_offset (qfv_imageset_t, size)},
{ }
};
static exprtab_t imageset_symtab = {
imageset_symbols,
};
exprtype_t imageset_type = {
"imageset",
sizeof (qfv_imageset_t *),
cexpr_struct_pointer_binops,
0,
&imageset_symtab,
};
static exprsym_t qfv_swapchain_t_symbols[] = {
{"format", &VkFormat_type, (void *)field_offset (qfv_swapchain_t, format)},
{"images", &imageset_type, (void *)field_offset (qfv_swapchain_t, images)},
{ }
};
static exprtab_t qfv_swapchain_t_symtab = {
qfv_swapchain_t_symbols,
};
exprtype_t qfv_swapchain_t_type = {
"qfv_swapchain_t",
sizeof (qfv_swapchain_t),
cexpr_struct_binops,
0,
&qfv_swapchain_t_symtab,
};
typedef struct qfv_renderpass_s {
qfv_attachmentdescription_t *attachments;
qfv_subpassparametersset_t *subpasses;
@ -566,6 +596,8 @@ QFV_InitParse (vulkan_ctx_t *ctx)
&ctx->hashlinks);
context.hashlinks = &ctx->hashlinks;
vkgen_init_symtabs (&context);
cexpr_init_symtab (&qfv_swapchain_t_symtab, &context);
cexpr_init_symtab (&imageset_symtab, &context);
}
exprenum_t *

View file

@ -18,7 +18,6 @@
VkPushConstantRange,
VkPipelineLayoutCreateInfo,
VkGraphicsPipelineCreateInfo,
qfv_swapchain_t,
);
handles = {
VkShaderModule = {
@ -61,10 +60,6 @@
},
);
parse = {
qfv_swapchain_s = {
.name = qfv_swapchain_t;
format = auto;
};
VkSubpassDescription = {
flags = auto;
pipelineBindPoint = auto;