summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-08-25 16:49:09 -0400
committerJonathan Bradley <jcb@pikum.xyz>2023-08-25 16:49:09 -0400
commit3b4bdce0aea6519f919c501898daea78d2a72858 (patch)
treef47132ab483ca7b23c0d46c04ee1a65bf7dd38eb /src
parent33ec2f26cc629aa91ee8602907708977086ddea6 (diff)
don't update extent until we're ready
Diffstat (limited to 'src')
-rw-r--r--src/window.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 4d816ca..999cfcc 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -862,6 +862,7 @@ void RecordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex) {
renderPassInfo.renderArea.extent = extent;
renderPassInfo.clearValueCount = 1;
renderPassInfo.pClearValues = &clearColor;
+ renderPassInfo.pNext = VK_NULL_HANDLE;
vkCmdBeginRenderPass(commandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, graphicsPipeline);
@@ -919,6 +920,9 @@ void RecreateSwapchain() {
glfwGetFramebufferSize(window, &width, &height);
glfwWaitEvents();
}
+ extent.width = width;
+ extent.height = height;
+ vkDeviceWaitIdle(vkDevice);
DestroySwapchain();
CreateSwapchain();
CreateFramebuffers();
@@ -929,8 +933,6 @@ void FramebufferResizeCallback(GLFWwindow *window, int width, int height) {
if (extent.width == width && extent.height != height) {
return;
}
- extent.width = width;
- extent.height = height;
shouldRecreateSwapchain = true;
}