diff --git a/include/QF/Vulkan/render.h b/include/QF/Vulkan/render.h index 080ae4e76..ed0c0e6ab 100644 --- a/include/QF/Vulkan/render.h +++ b/include/QF/Vulkan/render.h @@ -419,8 +419,9 @@ typedef struct qfv_renderctx_s { exprtab_t task_functions; qfv_jobinfo_t *jobinfo; qfv_samplerinfo_t *samplerinfo; - qfv_job_t *job; + qfv_job_t *job; qfv_renderframeset_t frames; + int64_t size_time; } qfv_renderctx_t; typedef struct qfv_taskctx_s { diff --git a/libs/video/renderer/vulkan/render.c b/libs/video/renderer/vulkan/render.c index a8ede28d9..fceb30807 100644 --- a/libs/video/renderer/vulkan/render.c +++ b/libs/video/renderer/vulkan/render.c @@ -420,8 +420,9 @@ update_framebuffer (const exprval_t **params, exprval_t *result, qfv_output_t output = {}; Vulkan_ConfigOutput (ctx, &output); - if (output.extent.width != render->output.extent.width - || output.extent.height != render->output.extent.height) { + if ((output.extent.width != render->output.extent.width + || output.extent.height != render->output.extent.height) + && (Sys_LongTime () - ctx->render_context->size_time) > 2*1000*1000) { QFV_DestroyFramebuffer (ctx, rp); update_viewport_scissor (render, &output); render->output.extent = output.extent; @@ -455,6 +456,7 @@ QFV_Render_Init (vulkan_ctx_t *ctx) { qfv_renderctx_t *rctx = calloc (1, sizeof (*rctx)); ctx->render_context = rctx; + rctx->size_time = -1000*1000*1000; exprctx_t ectx = { .hashctx = &rctx->hashctx }; exprsym_t syms[] = { {} }; diff --git a/libs/video/renderer/vulkan/vulkan_output.c b/libs/video/renderer/vulkan/vulkan_output.c index 62d6ee231..668100944 100644 --- a/libs/video/renderer/vulkan/vulkan_output.c +++ b/libs/video/renderer/vulkan/vulkan_output.c @@ -122,6 +122,7 @@ acquire_output (const exprval_t **params, exprval_t *result, exprctx_t *ectx) pl->scissor.extent = sc->extent; } } + rctx->size_time = Sys_LongTime (); } ctx->swapImageIndex = imageIndex; rp->beginInfo.framebuffer = octx->framebuffers[imageIndex];