blob: 2bb7e8369be9561c6d5d1f2ecca166952fac07f9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
using System;
using static Spv.Specification;
namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
{
static class EnumConversion
{
public static ExecutionModel Convert(this ShaderStage stage)
{
return stage switch
{
ShaderStage.Compute => ExecutionModel.GLCompute,
ShaderStage.Vertex => ExecutionModel.Vertex,
ShaderStage.TessellationControl => ExecutionModel.TessellationControl,
ShaderStage.TessellationEvaluation => ExecutionModel.TessellationEvaluation,
ShaderStage.Geometry => ExecutionModel.Geometry,
ShaderStage.Fragment => ExecutionModel.Fragment,
_ => throw new ArgumentException($"Invalid shader stage \"{stage}\"."),
};
}
}
}
|