@@ -190,10 +190,10 @@ VkExtent2D Swapchain::choose_extent(VkSurfaceCapabilitiesKHR capabilities) {
190190 return ext;
191191}
192192
193- Compositor::Compositor (Arc<Device, Alloc>& device , Arc<Descriptor_Pool , Alloc>& pool ,
194- Arc<Swapchain , Alloc> S )
195- : swapchain(move(S)), v(compositor_v( device.dup())), f(compositor_f (device.dup())),
196- ds_layout (device.dup(), compositor_ds_layout()),
193+ Compositor::Compositor (Arc<Device, Alloc> D , Arc<Swapchain , Alloc> S ,
194+ Arc<Descriptor_Pool , Alloc>& pool )
195+ : swapchain(move(S)), device(move(D)), v(compositor_v (device.dup())),
196+ f (compositor_f(device.dup())), ds_layout(device.dup(), compositor_ds_layout()),
197197 ds(pool->make (ds_layout, swapchain->frame_count ())),
198198 sampler(device.dup(), VK_FILTER_NEAREST, VK_FILTER_NEAREST),
199199 pipeline(Pipeline{device.dup (), compositor_pipeline_info (swapchain, ds_layout, v, f)}) {
@@ -243,7 +243,11 @@ void Compositor::render(Commands& cmds, u64 frame_index, u64 slot_index, bool ha
243243 vkCmdDraw (cmds, 4 , 1 , 0 , 0 );
244244 if (has_imgui) {
245245 ImGui::Render ();
246- if (auto draw = ImGui::GetDrawData ()) ImGui_ImplVulkan_RenderDrawData (draw, cmds);
246+ if (auto draw = ImGui::GetDrawData ()) {
247+ device->lock_queues ();
248+ ImGui_ImplVulkan_RenderDrawData (draw, cmds);
249+ device->unlock_queues ();
250+ }
247251 }
248252 vkCmdEndRendering (cmds);
249253}
0 commit comments