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