2019-12-15 23:59:46 -05:00
|
|
|
namespace Ryujinx.Graphics.Shader
|
|
|
|
{
|
2020-11-12 18:15:34 -05:00
|
|
|
public enum InputTopology : byte
|
2019-12-15 23:59:46 -05:00
|
|
|
{
|
|
|
|
Points,
|
|
|
|
Lines,
|
|
|
|
LinesAdjacency,
|
|
|
|
Triangles,
|
|
|
|
TrianglesAdjacency
|
|
|
|
}
|
|
|
|
|
|
|
|
static class InputTopologyExtensions
|
|
|
|
{
|
|
|
|
public static string ToGlslString(this InputTopology topology)
|
|
|
|
{
|
2022-04-08 06:42:39 -04:00
|
|
|
return topology switch
|
2019-12-15 23:59:46 -05:00
|
|
|
{
|
2022-04-08 06:42:39 -04:00
|
|
|
InputTopology.Points => "points",
|
|
|
|
InputTopology.Lines => "lines",
|
|
|
|
InputTopology.LinesAdjacency => "lines_adjacency",
|
|
|
|
InputTopology.Triangles => "triangles",
|
|
|
|
InputTopology.TrianglesAdjacency => "triangles_adjacency",
|
|
|
|
_ => "points"
|
|
|
|
};
|
|
|
|
}
|
2019-12-15 23:59:46 -05:00
|
|
|
|
2022-04-08 06:42:39 -04: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-15 23:59:46 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|