2019-10-13 02:02:07 -04:00
|
|
|
namespace Ryujinx.Graphics.Shader
|
|
|
|
{
|
2020-11-12 18:15:34 -05:00
|
|
|
public enum ShaderStage : byte
|
2019-10-13 02:02:07 -04:00
|
|
|
{
|
|
|
|
Compute,
|
|
|
|
Vertex,
|
|
|
|
TessellationControl,
|
|
|
|
TessellationEvaluation,
|
|
|
|
Geometry,
|
2020-11-12 18:15:34 -05:00
|
|
|
Fragment,
|
|
|
|
|
2023-06-28 02:59:13 -04:00
|
|
|
Count,
|
2019-10-13 02:02:07 -04:00
|
|
|
}
|
2022-01-08 12:48:48 -05:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2023-08-16 17:16:25 -04:00
|
|
|
|
|
|
|
/// <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;
|
|
|
|
}
|
2022-01-08 12:48:48 -05:00
|
|
|
}
|
2023-06-28 02:59:13 -04:00
|
|
|
}
|