Skip to content

Commit 351fa0e

Browse files
committed
Fix Vulkan validation errors
1 parent 931016b commit 351fa0e

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

pathfinder/gpu/vk/swap_chain.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,16 @@ void SwapChainVk::cleanup_swapchain() {
121121
void SwapChainVk::destroy() {
122122
auto vk_device = device_->get_device();
123123

124+
vkQueueWaitIdle(device_->get_graphics_queue());
125+
vkQueueWaitIdle(device_->get_present_queue());
126+
124127
encoder_of_last_frame_.reset();
125128

126129
// Clean up swap chain related resources.
127130
cleanup_swapchain();
128131

129132
for (size_t i = 0; i < swapchain_images_.size(); i++) {
130133
vkDestroySemaphore(vk_device, render_finished_semaphores_[i], nullptr);
131-
;
132134
}
133135

134136
// Clean up sync objects.

pathfinder/gpu/vk/window_builder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ void WindowBuilderVk::stop_and_destroy_swapchains() {
9898
}
9999

100100
primary_window_->swapchain_->destroy();
101+
primary_window_->destroy();
101102
}
102103

103104
uint8_t WindowBuilderVk::create_window(const Vec2I &size, const std::string &title) {

0 commit comments

Comments
 (0)