2019-12-16 05:59:46 +01:00
|
|
|
namespace Ryujinx.Graphics.Shader
|
|
|
|
{
|
2020-11-13 00:15:34 +01:00
|
|
|
public enum InputTopology : byte
|
2019-12-16 05:59:46 +01:00
|
|
|
{
|
|
|
|
Points,
|
|
|
|
Lines,
|
|
|
|
LinesAdjacency,
|
|
|
|
Triangles,
|
|
|
|
TrianglesAdjacency
|
|
|
|
}
|
|
|
|
|
|
|
|
static class InputTopologyExtensions
|
|
|
|
{
|
|
|
|
public static string ToGlslString(this InputTopology topology)
|
|
|
|
{
|
2022-04-08 12:42:39 +02:00
|
|
|
return topology switch
|
2019-12-16 05:59:46 +01:00
|
|
|
{
|
2022-04-08 12:42:39 +02:00
|
|
|
InputTopology.Points => "points",
|
|
|
|
InputTopology.Lines => "lines",
|
|
|
|
InputTopology.LinesAdjacency => "lines_adjacency",
|
|
|
|
InputTopology.Triangles => "triangles",
|
|
|
|
InputTopology.TrianglesAdjacency => "triangles_adjacency",
|
|
|
|
_ => "points"
|
|
|
|
};
|
|
|
|
}
|
2019-12-16 05:59:46 +01:00
|
|
|
|
2022-04-08 12:42:39 +02:00
|
|
|
public static int ToInputVertices(this InputTopology topology)
|
|
|
|
{
|
|
|
|
return topology switch
|
|
|
|
{
|
|
|
|
InputTopology.Points => 1,
|
|
|
|
InputTopology.Lines or
|
|
|
|
InputTopology.LinesAdjacency => 2,
|
|
|
|
InputTopology.Triangles or
|
|
|
|
InputTopology.TrianglesAdjacency => 3,
|
|
|
|
_ => 1
|
|
|
|
};
|
2019-12-16 05:59:46 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|