mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[vulkan] Rearrange init code in preparation for resizing
I've found and mostly isolated the parts of the code that will be affected by window resizing, minus pipelines but they use dynamic viewport and scissor settings and thus shouldn't be affected so long as the swapchain format doesn't change (how does that happen?)
This commit is contained in:
parent
9e440ff330
commit
0ecdd0e86b
3 changed files with 10 additions and 6 deletions
|
@ -64,5 +64,7 @@ qfv_renderpass_t *Vulkan_CreateRenderPass (struct vulkan_ctx_s *ctx,
|
||||||
qfv_draw_t draw);
|
qfv_draw_t draw);
|
||||||
void Vulkan_DestroyRenderPass (struct vulkan_ctx_s *ctx,
|
void Vulkan_DestroyRenderPass (struct vulkan_ctx_s *ctx,
|
||||||
qfv_renderpass_t *renderpass);
|
qfv_renderpass_t *renderpass);
|
||||||
|
void Vulkan_CreateAttachments (struct vulkan_ctx_s *ctx,
|
||||||
|
qfv_renderpass_t *renderpass);
|
||||||
|
|
||||||
#endif//__QF_Vulkan_renderpass_h
|
#endif//__QF_Vulkan_renderpass_h
|
||||||
|
|
|
@ -87,11 +87,12 @@ static void
|
||||||
vulkan_R_Init (void)
|
vulkan_R_Init (void)
|
||||||
{
|
{
|
||||||
Vulkan_CreateStagingBuffers (vulkan_ctx);
|
Vulkan_CreateStagingBuffers (vulkan_ctx);
|
||||||
Vulkan_CreateSwapchain (vulkan_ctx);
|
|
||||||
Vulkan_CreateFrames (vulkan_ctx);
|
Vulkan_CreateFrames (vulkan_ctx);
|
||||||
|
Vulkan_Texture_Init (vulkan_ctx);
|
||||||
|
|
||||||
|
Vulkan_CreateSwapchain (vulkan_ctx);
|
||||||
Vulkan_CreateCapture (vulkan_ctx);
|
Vulkan_CreateCapture (vulkan_ctx);
|
||||||
Vulkan_CreateRenderPasses (vulkan_ctx);
|
Vulkan_CreateRenderPasses (vulkan_ctx);
|
||||||
Vulkan_Texture_Init (vulkan_ctx);
|
|
||||||
|
|
||||||
Vulkan_Matrix_Init (vulkan_ctx);
|
Vulkan_Matrix_Init (vulkan_ctx);
|
||||||
Vulkan_Scene_Init (vulkan_ctx);
|
Vulkan_Scene_Init (vulkan_ctx);
|
||||||
|
|
|
@ -74,10 +74,11 @@ get_image_size (VkImage image, qfv_device_t *device)
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
create_attachements (vulkan_ctx_t *ctx, qfv_renderpass_t *rp)
|
Vulkan_CreateAttachments (vulkan_ctx_t *ctx, qfv_renderpass_t *renderpass)
|
||||||
{
|
{
|
||||||
qfv_device_t *device = ctx->device;
|
qfv_device_t *device = ctx->device;
|
||||||
|
__auto_type rp = renderpass;
|
||||||
|
|
||||||
plitem_t *item = get_rp_item (ctx, rp, "images");
|
plitem_t *item = get_rp_item (ctx, rp, "images");
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
@ -252,13 +253,13 @@ Vulkan_CreateRenderPass (vulkan_ctx_t *ctx, const char *name,
|
||||||
init_renderframe (ctx, rp, &rp->frames.a[i]);
|
init_renderframe (ctx, rp, &rp->frames.a[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
create_attachements (ctx, rp);
|
|
||||||
|
|
||||||
item = get_rp_item (ctx, rp, "clearValues");
|
item = get_rp_item (ctx, rp, "clearValues");
|
||||||
rp->clearValues = QFV_ParseClearValues (ctx, item, rp->renderpassDef);
|
rp->clearValues = QFV_ParseClearValues (ctx, item, rp->renderpassDef);
|
||||||
|
|
||||||
rp->draw = draw;
|
rp->draw = draw;
|
||||||
|
|
||||||
|
Vulkan_CreateAttachments (ctx, rp);
|
||||||
|
|
||||||
return rp;
|
return rp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue