0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Graphics.Gpu/State/PrimitiveTopology.cs

50 lines
2.1 KiB
C#
Raw Normal View History

2019-10-13 06:02:07 +00:00
using Ryujinx.Graphics.GAL;
namespace Ryujinx.Graphics.Gpu.State
{
enum PrimitiveType
{
Points,
Lines,
LineLoop,
LineStrip,
Triangles,
TriangleStrip,
TriangleFan,
Quads,
QuadStrip,
Polygon,
LinesAdjacency,
LineStripAdjacency,
TrianglesAdjacency,
TriangleStripAdjacency,
Patches
}
static class PrimitiveTypeConverter
{
public static PrimitiveTopology Convert(this PrimitiveType topology)
{
switch (topology)
{
case PrimitiveType.Points: return PrimitiveTopology.Points;
case PrimitiveType.Lines: return PrimitiveTopology.Lines;
case PrimitiveType.LineLoop: return PrimitiveTopology.LineLoop;
case PrimitiveType.LineStrip: return PrimitiveTopology.LineStrip;
case PrimitiveType.Triangles: return PrimitiveTopology.Triangles;
case PrimitiveType.TriangleStrip: return PrimitiveTopology.TriangleStrip;
case PrimitiveType.TriangleFan: return PrimitiveTopology.TriangleFan;
case PrimitiveType.Quads: return PrimitiveTopology.Quads;
case PrimitiveType.QuadStrip: return PrimitiveTopology.QuadStrip;
case PrimitiveType.Polygon: return PrimitiveTopology.Polygon;
case PrimitiveType.LinesAdjacency: return PrimitiveTopology.LinesAdjacency;
case PrimitiveType.LineStripAdjacency: return PrimitiveTopology.LineStripAdjacency;
case PrimitiveType.TrianglesAdjacency: return PrimitiveTopology.TrianglesAdjacency;
case PrimitiveType.TriangleStripAdjacency: return PrimitiveTopology.TriangleStripAdjacency;
case PrimitiveType.Patches: return PrimitiveTopology.Patches;
}
return PrimitiveTopology.Triangles;
}
}
}