[vulkan] Use references for views and pipelines

I'm pretty sure I don't want to require views to be created and
pipelines to be parsed just to parse the render pass info.
This commit is contained in:
Bill Currie 2023-02-12 02:40:52 +09:00
parent 345aa8e094
commit 728807bd7a
2 changed files with 36 additions and 6 deletions

View File

@ -8,6 +8,11 @@
#include "QF/simd/types.h"
typedef struct qfv_reference_s {
const char *name;
int line;
} qfv_reference_t;
typedef struct qfv_imageinfo_s {
const char *name;
VkImageCreateFlags flags;
@ -84,7 +89,7 @@ typedef struct qfv_attachmentsetinfo_s {
typedef struct qfv_pipelineinfo_s {
vec4f_t color;
const char *name;
VkGraphicsPipelineCreateInfo *pipeline;
qfv_reference_t pipeline;
uint32_t num_tasks;
qfv_taskinfo_t *tasks;
} qfv_pipelineinfo_t;
@ -100,11 +105,19 @@ typedef struct qfv_subpassinfo_s {
qfv_pipelineinfo_t *pipelines;
} qfv_subpassinfo_t;
typedef struct qfv_framebufferinfo_s {
qfv_reference_t *attachments;
uint32_t num_attachments;
uint32_t width;
uint32_t height;
uint32_t layers;
} qfv_framebufferinfo_t;
typedef struct qfv_renderpassinfo_s {
const char *name;
uint32_t num_attachments;
qfv_attachmentinfo_t *attachments;
VkFramebufferCreateInfo framebuffer;
qfv_framebufferinfo_t framebuffer;
uint32_t num_subpasses;
qfv_subpassinfo_t *subpasses;
} qfv_renderpassinfo_t;

View File

@ -43,6 +43,7 @@
qfv_taskinfo_t,
qfv_pipelineinfo_t,
qfv_subpassinfo_t,
qfv_framebufferinfo_t,
qfv_renderpassinfo_t,
qfv_renderinfo_t,
);
@ -476,10 +477,7 @@
type = string;
string = name;
};
pipeline = {
type = (single, VkGraphicsPipelineCreateInfo);
value = pipeline;
};
pipeline = auto;
tasks = {
type = (array, qfv_taskinfo_t);
size = num_tasks;
@ -508,6 +506,25 @@
values = pipelines;
};
};
qfv_framebufferinfo_s = {
.name = qfv_framebufferinfo_t;
attachments = {
type = (array, qfv_reference_t);
size = num_attachments;
values = attachments;
};
width = auto;
height = auto;
layers = auto;
};
qfv_reference_s = {
.name = qfv_reference_t;
.type = QFString;
.string = {
name = $item.string;
line = $item.line;
};
};
qfv_renderpassinfo_s = {
.name = qfv_renderpassinfo_t;
attachments = {