0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-12-27 03:25:46 +00:00
ryujinx-fork/Ryujinx.Graphics.OpenGL/Converters/StencilOpConverter.cs

28 lines
1.1 KiB
C#
Raw Normal View History

2019-10-13 06:02:07 +00:00
using OpenTK.Graphics.OpenGL;
using System;
namespace Ryujinx.Graphics.OpenGL
{
static class StencilOpConverter
{
public static StencilOp Convert(this GAL.DepthStencil.StencilOp op)
{
switch (op)
{
case GAL.DepthStencil.StencilOp.Keep: return StencilOp.Keep;
case GAL.DepthStencil.StencilOp.Zero: return StencilOp.Zero;
case GAL.DepthStencil.StencilOp.Replace: return StencilOp.Replace;
case GAL.DepthStencil.StencilOp.IncrementAndClamp: return StencilOp.Incr;
case GAL.DepthStencil.StencilOp.DecrementAndClamp: return StencilOp.Decr;
case GAL.DepthStencil.StencilOp.Invert: return StencilOp.Invert;
case GAL.DepthStencil.StencilOp.IncrementAndWrap: return StencilOp.IncrWrap;
case GAL.DepthStencil.StencilOp.DecrementAndWrap: return StencilOp.DecrWrap;
}
return StencilOp.Keep;
throw new ArgumentException($"Invalid stencil operation \"{op}\".");
}
}
}