2019-10-13 08:02:07 +02: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)
|
|
|
|
{
|
2019-12-05 21:34:47 +01:00
|
|
|
case BlendOp.Add:
|
|
|
|
case BlendOp.AddGl:
|
|
|
|
return BlendEquationMode.FuncAdd;
|
|
|
|
case BlendOp.Subtract:
|
|
|
|
case BlendOp.SubtractGl:
|
|
|
|
return BlendEquationMode.FuncSubtract;
|
|
|
|
case BlendOp.ReverseSubtract:
|
|
|
|
case BlendOp.ReverseSubtractGl:
|
|
|
|
return BlendEquationMode.FuncReverseSubtract;
|
|
|
|
case BlendOp.Minimum:
|
|
|
|
case BlendOp.MinimumGl:
|
|
|
|
return BlendEquationMode.Min;
|
|
|
|
case BlendOp.Maximum:
|
|
|
|
case BlendOp.MaximumGl:
|
|
|
|
return BlendEquationMode.Max;
|
2019-10-13 08:02:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return BlendEquationMode.FuncAdd;
|
|
|
|
|
|
|
|
throw new ArgumentException($"Invalid blend operation \"{op}\".");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|