Vulkan Example: Fix synchronization.

This commit is contained in:
Håvard Mathisen 2016-03-10 11:59:42 +01:00
parent 0ceddc29ff
commit 4ea4fa3e73
2 changed files with 1 additions and 17 deletions

View File

@ -605,14 +605,6 @@ bool ImGui_ImplGlfwVulkan_CreateFontsTexture(VkCommandBuffer command_buffer)
} }
// Upload Barrier: // 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] = {}; VkImageMemoryBarrier image_barrier[1] = {};
image_barrier[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; image_barrier[0].sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
image_barrier[0].dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; 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_HOST_BIT,
VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
0, 0,
0, NULL, 1, buffer_barrier, 1, image_barrier); 0, NULL, 0, NULL, 1, image_barrier);
} }
// Copy to Image: // Copy to Image:
{ {

View File

@ -311,14 +311,6 @@ static void frame_begin()
if(err == VK_TIMEOUT) continue; if(err == VK_TIMEOUT) continue;
check_vk_result(err); 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( err = vkAcquireNextImageKHR(
g_Device, g_Swapchain, g_Device, g_Swapchain,