From 52c32c2d7b9a800a30f7480f3f71e493942f2636 Mon Sep 17 00:00:00 2001 From: neither-nor Date: Tue, 28 Sep 2021 16:21:35 +0800 Subject: [PATCH] fix layout transition --- examples/texturesparseresidency/texturesparseresidency.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/texturesparseresidency/texturesparseresidency.cpp b/examples/texturesparseresidency/texturesparseresidency.cpp index 246c88f2..d3585cf2 100644 --- a/examples/texturesparseresidency/texturesparseresidency.cpp +++ b/examples/texturesparseresidency/texturesparseresidency.cpp @@ -742,7 +742,7 @@ void VulkanExample::uploadContent(VirtualTexturePage page, VkImage image) } VkCommandBuffer copyCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true); - vks::tools::setImageLayout(copyCmd, image, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, texture.subRange, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT); + vks::tools::setImageLayout(copyCmd, image, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, texture.subRange, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT); VkBufferImageCopy region{}; region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; region.imageSubresource.layerCount = 1; @@ -755,7 +755,7 @@ void VulkanExample::uploadContent(VirtualTexturePage page, VkImage image) imageBuffer.destroy(); } - + void VulkanExample::fillRandomPages() { vkDeviceWaitIdle(device);