From 4ea4fa3e7318af552c5ea8fd36360babcb51c9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Mathisen?= Date: Thu, 10 Mar 2016 11:59:42 +0100 Subject: [PATCH] Vulkan Example: Fix synchronization. --- examples/vulkan_example/imgui_impl_glfw_vulkan.cpp | 10 +--------- examples/vulkan_example/main.cpp | 8 -------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp b/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp index 7ca1ab9f..ae479056 100644 --- a/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp +++ b/examples/vulkan_example/imgui_impl_glfw_vulkan.cpp @@ -605,14 +605,6 @@ bool ImGui_ImplGlfwVulkan_CreateFontsTexture(VkCommandBuffer command_buffer) } // Upload Barrier: { - VkBufferMemoryBarrier buffer_barrier[1] = {}; - buffer_barrier[0].sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; - buffer_barrier[0].srcAccessMask = VK_ACCESS_HOST_WRITE_BIT; - buffer_barrier[0].dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; - buffer_barrier[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; - buffer_barrier[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; - buffer_barrier[0].buffer = g_UploadBuffer; - buffer_barrier[0].size = upload_size; VkImageMemoryBarrier image_barrier[1] = {}; image_barrier[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; image_barrier[0].dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; @@ -628,7 +620,7 @@ bool ImGui_ImplGlfwVulkan_CreateFontsTexture(VkCommandBuffer command_buffer) VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, - 0, NULL, 1, buffer_barrier, 1, image_barrier); + 0, NULL, 0, NULL, 1, image_barrier); } // Copy to Image: { diff --git a/examples/vulkan_example/main.cpp b/examples/vulkan_example/main.cpp index c42bcdf6..293f0557 100644 --- a/examples/vulkan_example/main.cpp +++ b/examples/vulkan_example/main.cpp @@ -311,14 +311,6 @@ static void frame_begin() if(err == VK_TIMEOUT) continue; check_vk_result(err); } - { - vkDestroySemaphore(g_Device, g_Semaphore[g_FrameIndex], g_Allocator); - VkSemaphoreCreateInfo info = {}; - info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; - err = vkCreateSemaphore(g_Device, &info, g_Allocator, - &g_Semaphore[g_FrameIndex]); - check_vk_result(err); - } { err = vkAcquireNextImageKHR( g_Device, g_Swapchain,