mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-18 09:51:40 +00:00
[vulkan] Add list of views to qfv_output_t
I'm not sure I like it, but it was an easy solution to dealing with per-frame views when setting up a renderpass that has a framebuffer spec.
This commit is contained in:
parent
e1c4428c8e
commit
3b72c9847a
3 changed files with 6 additions and 8 deletions
|
@ -14,6 +14,7 @@ typedef struct qfv_output_s {
|
||||||
VkExtent2D extent;
|
VkExtent2D extent;
|
||||||
VkImageView view;
|
VkImageView view;
|
||||||
VkFormat format;
|
VkFormat format;
|
||||||
|
VkImageView *view_list; // per frame
|
||||||
} qfv_output_t;
|
} qfv_output_t;
|
||||||
|
|
||||||
typedef struct vulkan_frame_s {
|
typedef struct vulkan_frame_s {
|
||||||
|
|
|
@ -119,11 +119,7 @@ create_attachements (vulkan_ctx_t *ctx, qfv_renderpass_t *rp)
|
||||||
rp->framebuffers = QFV_AllocFrameBuffers (ctx->swapchain->numImages,
|
rp->framebuffers = QFV_AllocFrameBuffers (ctx->swapchain->numImages,
|
||||||
malloc);
|
malloc);
|
||||||
for (size_t i = 0; i < rp->framebuffers->size; i++) {
|
for (size_t i = 0; i < rp->framebuffers->size; i++) {
|
||||||
ctx->output = (qfv_output_t) {
|
ctx->output.view = ctx->output.view_list[i];
|
||||||
.extent = ctx->swapchain->extent,
|
|
||||||
.view = ctx->swapchain->imageViews->a[i],
|
|
||||||
.format = ctx->swapchain->format,
|
|
||||||
};
|
|
||||||
rp->framebuffers->a[i] = QFV_ParseFramebuffer (ctx, item,
|
rp->framebuffers->a[i] = QFV_ParseFramebuffer (ctx, item,
|
||||||
rp->renderpassDef);
|
rp->renderpassDef);
|
||||||
}
|
}
|
||||||
|
|
|
@ -379,9 +379,10 @@ void
|
||||||
Vulkan_CreateRenderPasses (vulkan_ctx_t *ctx)
|
Vulkan_CreateRenderPasses (vulkan_ctx_t *ctx)
|
||||||
{
|
{
|
||||||
qfv_output_t output = {
|
qfv_output_t output = {
|
||||||
.extent = ctx->swapchain->extent,
|
.extent = ctx->swapchain->extent,
|
||||||
.view = ctx->swapchain->imageViews->a[0],
|
.view = ctx->swapchain->imageViews->a[0],
|
||||||
.format = ctx->swapchain->format,
|
.format = ctx->swapchain->format,
|
||||||
|
.view_list = ctx->swapchain->imageViews->a,
|
||||||
};
|
};
|
||||||
__auto_type rp = Vulkan_CreateRenderPass (ctx, "deferred",
|
__auto_type rp = Vulkan_CreateRenderPass (ctx, "deferred",
|
||||||
&output, renderpass_draw);
|
&output, renderpass_draw);
|
||||||
|
|
Loading…
Reference in a new issue