[vulkan] Get render info parsing partially working

A bunch of missed struct members, incorrect parse types, and some logic
errors in the parse setup. Still not working due to problems with
vectors from plist string references and some other errors, but getting
there.
This commit is contained in:
Bill Currie 2023-02-10 19:45:02 +09:00
parent 7235fcb5b9
commit 2287a3de3f
4 changed files with 55 additions and 62 deletions

View file

@ -19,6 +19,7 @@ typedef struct qfv_imageinfo_s {
VkSampleCountFlagBits samples;
VkImageTiling tiling;
VkImageUsageFlags usage;
VkImageLayout initialLayout;
} qfv_imageinfo_t;
typedef struct qfv_imageviewinfo_s {
@ -56,6 +57,7 @@ typedef struct qfv_attachmentinfo_s {
VkAttachmentStoreOp stencilStoreOp;
VkImageLayout initialLayout;
VkImageLayout finalLayout;
VkClearValue clearValue;
} qfv_attachmentinfo_t;
typedef struct qfv_taskinfo_s {
@ -64,15 +66,20 @@ typedef struct qfv_taskinfo_s {
} qfv_taskinfo_t;
typedef struct qfv_attachmentrefinfo_s {
const char *name;
VkImageLayout layout;
} qfv_attachmentrefinfo_t;
typedef struct qfv_attachmentsetinfo_s {
uint32_t num_input;
const char **input;
qfv_attachmentrefinfo_t *input;
uint32_t num_color;
const char **color;
const char **resolve;
const char **depth;
qfv_attachmentrefinfo_t *color;
qfv_attachmentrefinfo_t *resolve;
qfv_attachmentrefinfo_t *depth;
uint32_t num_preserve;
const char **preserve;
} qfv_attachmentrefinfo_t;
} qfv_attachmentsetinfo_t;
typedef struct qfv_pipelineinfo_s {
vec4f_t color;

View file

@ -69,34 +69,34 @@ properties = {
};
images = {
depth = {
@inherit = image_base;
@inherit = $image_base;
format = x8_d24_unorm_pack32;
usage = depth_stencil_attachment|input_attachment|transient_attachment;
};
color = {
@inherit = image_base;
@inherit = $image_base;
format = r8g8b8a8_unorm;
};
emission = {
@inherit = image_base;
@inherit = $image_base;
format = r16g16b16a16_sfloat;
};
normal = {
@inherit = image_base;
@inherit = $image_base;
format = r16g16b16a16_sfloat;
};
position = {
@inherit = image_base;
@inherit = $image_base;
format = r32g32b32a32_sfloat;
};
opaque = {
@inherit = image_base;
@inherit = $image_base;
format = r16g16b16a16_sfloat;
};
};
views = {
depth = {
@inherit = view_base;
@inherit = $view_base;
image = depth;
format = $images.depth.format;
subresourceRange = {
@ -104,32 +104,32 @@ views = {
};
};
color = {
@inherit = view_base;
@inherit = $view_base;
image = color;
format = $images.color.format;
};
emission = {
@inherit = view_base;
image = color;
format = $images.color.format;
@inherit = $view_base;
image = emission;
format = $images.emission.format;
};
normal = {
@inherit = view_base;
image = color;
format = $images.color.format;
@inherit = $view_base;
image = normal;
format = $images.normal.format;
};
position = {
@inherit = view_base;
image = color;
format = $images.color.format;
@inherit = $view_base;
image = position;
format = $images.position.format;
};
opaque = {
@inherit = view_base;
image = color;
format = $images.color.format;
@inherit = $view_base;
image = opaque;
format = $images.opaque.format;
};
output = {
@inherit = view_base;
@inherit = $view_base;
image = $output.image;
format = $output.format;
}
@ -169,7 +169,7 @@ renderpasses = {
};
output = {
@inherit = $attachment_base;
format = $images.output.format;
format = $output.format;
loadOp = clear;
storeOp = store;
finalLayout = $output.finalLayout;

View file

@ -2150,12 +2150,12 @@ QFV_ParseRenderInfo (vulkan_ctx_t *ctx, plitem_t *item)
var_syms[num_keys + 0] = (exprsym_t) {
.name = "images",
.type = &cexpr_plitem,
.value = pl_items + 0,
.value = pl_items + num_keys + 0,
},
var_syms[num_keys + 1] = (exprsym_t) {
.name = "views",
.type = &cexpr_plitem,
.value = pl_items + 1,
.value = pl_items + num_keys + 1,
},
var_syms[num_keys + 2] = (exprsym_t) {
.name = "output",

View file

@ -39,6 +39,7 @@
qfv_dependencyinfo_t,
qfv_attachmentinfo_t,
qfv_attachmentrefinfo_t,
qfv_attachmentsetinfo_t,
qfv_taskinfo_t,
qfv_pipelineinfo_t,
qfv_subpassinfo_t,
@ -434,47 +435,31 @@
};
qfv_attachmentrefinfo_s = {
.name = qfv_attachmentrefinfo_t;
.only = layout;
};
qfv_attachmentsetinfo_s = {
.name = qfv_attachmentsetinfo_t;
input = {
type = (array, {
parse_type = QFString;
type = "char *";
parser = parse_string;
});
type = (labeledarray, qfv_attachmentrefinfo_t, name);
size = num_input;
values = input;
};
color = {
type = (array, {
parse_type = QFString;
type = "char *";
parser = parse_string;
});
type = (labeledarray, qfv_attachmentrefinfo_t, name);
size = num_color;
values = color;
};
resolve = {
type = (array, {
parse_type = QFString;
type = "char *";
parser = parse_string;
});
type = (labeledarray, qfv_attachmentrefinfo_t, name);
values = resolve;
matchSize = color;
};
depth = {
type = (single, {
parse_type = QFString;
type = "char *";
parser = parse_string;
});
type = (labeledsingle, qfv_attachmentrefinfo_t, name);
value = depth;
};
preserve = {
type = (array, {
parse_type = QFString;
type = "char *";
parser = parse_string;
});
type = (labeledarray, qfv_attachmentrefinfo_t, name);
size = num_preserve;
values = preserve;
};
@ -502,17 +487,18 @@
type = string;
string = name;
};
color = auto;
dependencies = {
type = (array, qfv_dependencyinfo_t);
type = (labeledarray, qfv_dependencyinfo_t, name);
size = num_dependencies;
values = dependencies;
};
attachments = {
type = (single, qfv_attachmentrefinfo_t);
type = (single, qfv_attachmentsetinfo_t);
value = attachments;
};
pipelines = {
type = (array, qfv_pipelineinfo_t);
type = (labeledarray, qfv_pipelineinfo_t, name);
size = num_pipelines;
values = pipelines;
};
@ -520,13 +506,13 @@
qfv_renderpassinfo_s = {
.name = qfv_renderpassinfo_t;
attachments = {
type = (array, qfv_attachmentinfo_t);
type = (labeledarray, qfv_attachmentinfo_t, name);
size = num_attachments;
values = attachments;
};
framebuffer = auto;
subpasses = {
type = (array, qfv_subpassinfo_t);
type = (labeledarray, qfv_subpassinfo_t, name);
size = num_subpasses;
values = subpasses;
};
@ -535,17 +521,17 @@
.name = qfv_renderinfo_t;
properties = ignore;
images = {
type = (array, qfv_imageinfo_t);
type = (labeledarray, qfv_imageinfo_t, name);
size = num_images;
values = images;
};
views = {
type = (array, qfv_imageviewinfo_t);
type = (labeledarray, qfv_imageviewinfo_t, name);
size = num_views;
values = views;
};
renderpasses = {
type = (array, qfv_renderpassinfo_t);
type = (labeledarray, qfv_renderpassinfo_t, name);
size = num_renderpasses;
values = renderpasses;
};