2018-08-10 00:09:40 -04:00
|
|
|
|
namespace Ryujinx.Graphics.Gal
|
|
|
|
|
{
|
2018-10-17 17:02:23 -04:00
|
|
|
|
public struct ColorMaskRgba
|
|
|
|
|
{
|
|
|
|
|
private static readonly ColorMaskRgba _Default = new ColorMaskRgba()
|
|
|
|
|
{
|
|
|
|
|
Red = true,
|
|
|
|
|
Green = true,
|
|
|
|
|
Blue = true,
|
|
|
|
|
Alpha = true
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public static ColorMaskRgba Default => _Default;
|
|
|
|
|
|
|
|
|
|
public bool Red;
|
|
|
|
|
public bool Green;
|
|
|
|
|
public bool Blue;
|
|
|
|
|
public bool Alpha;
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public class GalPipelineState
|
|
|
|
|
{
|
2018-10-17 17:02:23 -04:00
|
|
|
|
public const int Stages = 5;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public const int ConstBuffersPerStage = 18;
|
2018-10-17 17:02:23 -04:00
|
|
|
|
public const int RenderTargetsCount = 8;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
|
|
|
|
|
public long[][] ConstBufferKeys;
|
|
|
|
|
|
|
|
|
|
public GalVertexBinding[] VertexBindings;
|
|
|
|
|
|
2018-09-18 00:30:35 -04:00
|
|
|
|
public bool FramebufferSrgb;
|
|
|
|
|
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public float FlipX;
|
|
|
|
|
public float FlipY;
|
|
|
|
|
|
2018-08-25 00:16:58 -04:00
|
|
|
|
public int Instance;
|
|
|
|
|
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public GalFrontFace FrontFace;
|
|
|
|
|
|
2018-10-25 17:30:09 -04:00
|
|
|
|
public bool CullFaceEnabled;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public GalCullFace CullFace;
|
|
|
|
|
|
2018-10-25 17:30:09 -04:00
|
|
|
|
public bool DepthTestEnabled;
|
|
|
|
|
public bool DepthWriteEnabled;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public GalComparisonOp DepthFunc;
|
2018-10-23 15:04:08 -04:00
|
|
|
|
public float DepthRangeNear;
|
|
|
|
|
public float DepthRangeFar;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
|
|
|
|
|
public bool StencilTestEnabled;
|
2018-10-13 22:54:14 -04:00
|
|
|
|
public bool StencilTwoSideEnabled;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
|
|
|
|
|
public GalComparisonOp StencilBackFuncFunc;
|
2018-10-25 17:30:09 -04:00
|
|
|
|
public int StencilBackFuncRef;
|
|
|
|
|
public uint StencilBackFuncMask;
|
|
|
|
|
public GalStencilOp StencilBackOpFail;
|
|
|
|
|
public GalStencilOp StencilBackOpZFail;
|
|
|
|
|
public GalStencilOp StencilBackOpZPass;
|
|
|
|
|
public uint StencilBackMask;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
|
|
|
|
|
public GalComparisonOp StencilFrontFuncFunc;
|
2018-10-25 17:30:09 -04:00
|
|
|
|
public int StencilFrontFuncRef;
|
|
|
|
|
public uint StencilFrontFuncMask;
|
|
|
|
|
public GalStencilOp StencilFrontOpFail;
|
|
|
|
|
public GalStencilOp StencilFrontOpZFail;
|
|
|
|
|
public GalStencilOp StencilFrontOpZPass;
|
|
|
|
|
public uint StencilFrontMask;
|
|
|
|
|
|
|
|
|
|
public bool BlendEnabled;
|
|
|
|
|
public bool BlendSeparateAlpha;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public GalBlendEquation BlendEquationRgb;
|
2018-10-25 17:30:09 -04:00
|
|
|
|
public GalBlendFactor BlendFuncSrcRgb;
|
|
|
|
|
public GalBlendFactor BlendFuncDstRgb;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public GalBlendEquation BlendEquationAlpha;
|
2018-10-25 17:30:09 -04:00
|
|
|
|
public GalBlendFactor BlendFuncSrcAlpha;
|
|
|
|
|
public GalBlendFactor BlendFuncDstAlpha;
|
2018-08-10 00:09:40 -04:00
|
|
|
|
|
2018-10-25 17:30:09 -04:00
|
|
|
|
public bool ColorMaskCommon;
|
2018-10-17 17:02:23 -04:00
|
|
|
|
public ColorMaskRgba[] ColorMasks;
|
2018-10-13 22:54:14 -04:00
|
|
|
|
|
2018-08-10 00:09:40 -04:00
|
|
|
|
public bool PrimitiveRestartEnabled;
|
|
|
|
|
public uint PrimitiveRestartIndex;
|
|
|
|
|
|
|
|
|
|
public GalPipelineState()
|
|
|
|
|
{
|
|
|
|
|
ConstBufferKeys = new long[Stages][];
|
|
|
|
|
|
|
|
|
|
for (int Stage = 0; Stage < Stages; Stage++)
|
|
|
|
|
{
|
|
|
|
|
ConstBufferKeys[Stage] = new long[ConstBuffersPerStage];
|
|
|
|
|
}
|
2018-10-17 17:02:23 -04:00
|
|
|
|
|
|
|
|
|
ColorMasks = new ColorMaskRgba[RenderTargetsCount];
|
2018-08-10 00:09:40 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|