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