0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Graphics.OpenGL/Converters/BlendOpConverter.cs
2020-01-09 02:13:00 +01:00

25 lines
836 B
C#

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}\".");
}
}
}