From 167300eef147f3008876516a6464196458518ccc Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 11 Feb 2022 12:56:17 -0800 Subject: gfx: Various Vulkan fixes. (#2129) * gfx: Various Vulkan fixes. * Fix test case. * Fix vulkan crash. Co-authored-by: Yong He --- tools/gfx/vulkan/vk-util.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tools/gfx/vulkan/vk-util.cpp') diff --git a/tools/gfx/vulkan/vk-util.cpp b/tools/gfx/vulkan/vk-util.cpp index ea87e7c68..633239f24 100644 --- a/tools/gfx/vulkan/vk-util.cpp +++ b/tools/gfx/vulkan/vk-util.cpp @@ -157,6 +157,7 @@ VkImageLayout VulkanUtil::getImageLayoutFromState(ResourceState state) case ResourceState::ShaderResource: return VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; case ResourceState::UnorderedAccess: + case ResourceState::General: return VK_IMAGE_LAYOUT_GENERAL; case ResourceState::Present: return VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; @@ -200,8 +201,18 @@ VkImageLayout VulkanUtil::getImageLayoutFromState(ResourceState state) { switch (topology) { - case PrimitiveTopology::TriangleList: return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; - default: break; + case PrimitiveTopology::LineList: + return VK_PRIMITIVE_TOPOLOGY_LINE_LIST; + case PrimitiveTopology::LineStrip: + return VK_PRIMITIVE_TOPOLOGY_LINE_STRIP; + case PrimitiveTopology::TriangleList: + return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; + case PrimitiveTopology::TriangleStrip: + return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP; + case PrimitiveTopology::PointList: + return VK_PRIMITIVE_TOPOLOGY_POINT_LIST; + default: + break; } assert(!"Unknown topology"); return VK_PRIMITIVE_TOPOLOGY_MAX_ENUM; -- cgit v1.2.3