aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/EnumConversion.cs
blob: d444588e84121e83ff4d493abb61984c8680a22b (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}\"."),
            };
        }
    }
}