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.

Pull Request: https://projects.blender.org/blender/blender/pulls/108421
This commit is contained in:
Jeroen Bakker
2023-05-30 13:45:41 +02:00
parent 3fece69e6b
commit 84cb112b4e

View File

@@ -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. */