From 48ae492b2f785ece36e592099b6b260efb9fdb38 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 30 May 2023 13:32:24 +0200 Subject: [PATCH] Vulkan: Restart Index This PR adds support for restart indices. Restart indices are for example used during hair rendering where an index buffer contains multiple hair strands. When in the index buffer a restart index is added, a new line will start, instead of continuing extending the previous line. --- source/blender/gpu/vulkan/vk_pipeline.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/gpu/vulkan/vk_pipeline.cc b/source/blender/gpu/vulkan/vk_pipeline.cc index 5eabab52582..966d1511dcd 100644 --- a/source/blender/gpu/vulkan/vk_pipeline.cc +++ b/source/blender/gpu/vulkan/vk_pipeline.cc @@ -156,6 +156,8 @@ void VKPipeline::finalize(VKContext &context, VkPipelineInputAssemblyStateCreateInfo pipeline_input_assembly = {}; pipeline_input_assembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; pipeline_input_assembly.topology = to_vk_primitive_topology(prim_type); + pipeline_input_assembly.primitiveRestartEnable = + ELEM(prim_type, GPU_PRIM_TRIS, GPU_PRIM_LINES, GPU_PRIM_POINTS) ? VK_FALSE : VK_TRUE; pipeline_create_info.pInputAssemblyState = &pipeline_input_assembly; /* Viewport state. */ -- 2.30.2