forked from Ryubing/Ryujinx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShaderStage.cs
40 lines (37 loc) · 1.31 KB
/
ShaderStage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace Ryujinx.Graphics.Shader
{
public enum ShaderStage : byte
{
Compute,
Vertex,
TessellationControl,
TessellationEvaluation,
Geometry,
Fragment,
Count,
}
public static class ShaderStageExtensions
{
/// <summary>
/// Checks if the shader stage supports render scale.
/// </summary>
/// <param name="stage">Shader stage</param>
/// <returns>True if the shader stage supports render scale, false otherwise</returns>
public static bool SupportsRenderScale(this ShaderStage stage)
{
return stage == ShaderStage.Vertex || stage == ShaderStage.Fragment || stage == ShaderStage.Compute;
}
/// <summary>
/// Checks if the shader stage is vertex, tessellation or geometry.
/// </summary>
/// <param name="stage">Shader stage</param>
/// <returns>True if the shader stage is vertex, tessellation or geometry, false otherwise</returns>
public static bool IsVtg(this ShaderStage stage)
{
return stage == ShaderStage.Vertex ||
stage == ShaderStage.TessellationControl ||
stage == ShaderStage.TessellationEvaluation ||
stage == ShaderStage.Geometry;
}
}
}