0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-12-26 15:05:45 +00:00
ryujinx-fork/Ryujinx.Graphics.OpenGL/Converters/BlendOpConverter.cs

26 lines
836 B
C#
Raw Normal View History

2019-10-13 06:02:07 +00:00
using OpenTK.Graphics.OpenGL;
using Ryujinx.Graphics.GAL.Blend;
using System;
namespace Ryujinx.Graphics.OpenGL
{
static class BlendOpConverter
{
public static BlendEquationMode Convert(this BlendOp op)
{
switch (op)
{
case BlendOp.Add: return BlendEquationMode.FuncAdd;
case BlendOp.Subtract: return BlendEquationMode.FuncSubtract;
case BlendOp.ReverseSubtract: return BlendEquationMode.FuncReverseSubtract;
case BlendOp.Minimum: return BlendEquationMode.Min;
case BlendOp.Maximum: return BlendEquationMode.Max;
}
return BlendEquationMode.FuncAdd;
throw new ArgumentException($"Invalid blend operation \"{op}\".");
}
}
}