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,
|
2023-06-28 08:59:13 +02:00
|
|
|
TrianglesAdjacency,
|
2019-12-16 05:59:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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",
|
2023-06-28 08:59:13 +02:00
|
|
|
_ => "points",
|
2022-04-08 12:42:39 +02:00
|
|
|
};
|
|
|
|
}
|
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,
|
2023-06-28 08:59:13 +02:00
|
|
|
_ => 1,
|
2022-04-08 12:42:39 +02:00
|
|
|
};
|
2019-12-16 05:59:46 +01:00
|
|
|
}
|
|
|
|
}
|
2023-06-28 08:59:13 +02:00
|
|
|
}
|