Skip to content
Permalink
Browse files

[Vulkan] PipelineState: Properly set PrimitiveRestartEnable

  • Loading branch information
xen2 committed Jul 26, 2019
1 parent 7f293fa commit 7c4be8d30a3f760eed82c571b36c2805fa34232d
@@ -107,7 +107,7 @@ private unsafe void Recreate()
{
StructureType = StructureType.PipelineInputAssemblyStateCreateInfo,
Topology = VulkanConvertExtensions.ConvertPrimitiveType(Description.PrimitiveType),
PrimitiveRestartEnable = true,
PrimitiveRestartEnable = VulkanConvertExtensions.ConvertPrimitiveRestart(Description.PrimitiveType),
};

// TODO VULKAN: Tessellation and multisampling
@@ -68,6 +68,22 @@ public static PrimitiveTopology ConvertPrimitiveType(PrimitiveType primitiveType
}
}

public static bool ConvertPrimitiveRestart(PrimitiveType primitiveType)
{
switch (primitiveType)
{
case PrimitiveType.PointList:
case PrimitiveType.LineList:
case PrimitiveType.TriangleList:
case PrimitiveType.LineListWithAdjacency:
case PrimitiveType.TriangleListWithAdjacency:
case PrimitiveType.PatchList:
return false;
default:
return true;
}
}

public static ShaderStageFlags Convert(ShaderStage stage)
{
switch (stage)

0 comments on commit 7c4be8d

Please sign in to comment.
You can’t perform that action at this time.