diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-04-08 07:42:39 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 12:42:39 +0200 |
commit | e44a43c7e1ee0b25ef93a9419dbd6ac2eb7665b5 (patch) | |
tree | d0587a15710c0d7a525117c22304e717b7fea2ec /Ryujinx.Graphics.Shader/InputTopology.cs | |
parent | 3139a85a2b8e83aa6babfbc683bd46ca1d75e448 (diff) |
Implement VMAD shader instruction and improve InvocationInfo and ISBERD handling (#3251)1.1.99
* Implement VMAD shader instruction and improve InvocationInfo and ISBERD handling
* Shader cache version bump
* Fix typo
Diffstat (limited to 'Ryujinx.Graphics.Shader/InputTopology.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/InputTopology.cs | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.Shader/InputTopology.cs b/Ryujinx.Graphics.Shader/InputTopology.cs index 429aa211..da332909 100644 --- a/Ryujinx.Graphics.Shader/InputTopology.cs +++ b/Ryujinx.Graphics.Shader/InputTopology.cs @@ -13,16 +13,28 @@ namespace Ryujinx.Graphics.Shader { public static string ToGlslString(this InputTopology topology) { - switch (topology) + return topology switch { - case InputTopology.Points: return "points"; - case InputTopology.Lines: return "lines"; - case InputTopology.LinesAdjacency: return "lines_adjacency"; - case InputTopology.Triangles: return "triangles"; - case InputTopology.TrianglesAdjacency: return "triangles_adjacency"; - } + InputTopology.Points => "points", + InputTopology.Lines => "lines", + InputTopology.LinesAdjacency => "lines_adjacency", + InputTopology.Triangles => "triangles", + InputTopology.TrianglesAdjacency => "triangles_adjacency", + _ => "points" + }; + } - return "points"; + 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 + }; } } }
\ No newline at end of file |