aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/GalPipelineState.cs
blob: 7c66951415a102b407428b7f9619b7e3722ea7b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
namespace Ryujinx.Graphics.Gal
{
    public struct GalVertexBinding
    {
        //VboKey shouldn't be here, but ARB_vertex_attrib_binding is core since 4.3

        public bool Enabled;
        public int Stride;
        public long VboKey;
        public bool Instanced;
        public int Divisor;
        public GalVertexAttrib[] Attribs;
    }

    public class GalPipelineState
    {
        public const int Stages = 5;
        public const int ConstBuffersPerStage = 18;

        public long[][] ConstBufferKeys;

        public GalVertexBinding[] VertexBindings;

        public float FlipX;
        public float FlipY;

        public int Instance;

        public GalFrontFace FrontFace;

        public bool CullFaceEnabled;
        public GalCullFace CullFace;

        public bool DepthTestEnabled;
        public GalComparisonOp DepthFunc;

        public bool StencilTestEnabled;

        public GalComparisonOp StencilBackFuncFunc;
        public int StencilBackFuncRef;
        public uint StencilBackFuncMask;
        public GalStencilOp StencilBackOpFail;
        public GalStencilOp StencilBackOpZFail;
        public GalStencilOp StencilBackOpZPass;
        public uint StencilBackMask;

        public GalComparisonOp StencilFrontFuncFunc;
        public int StencilFrontFuncRef;
        public uint StencilFrontFuncMask;
        public GalStencilOp StencilFrontOpFail;
        public GalStencilOp StencilFrontOpZFail;
        public GalStencilOp StencilFrontOpZPass;
        public uint StencilFrontMask;

        public bool BlendEnabled;
        public bool BlendSeparateAlpha;
        public GalBlendEquation BlendEquationRgb;
        public GalBlendFactor BlendFuncSrcRgb;
        public GalBlendFactor BlendFuncDstRgb;
        public GalBlendEquation BlendEquationAlpha;
        public GalBlendFactor BlendFuncSrcAlpha;
        public GalBlendFactor BlendFuncDstAlpha;

        public bool PrimitiveRestartEnabled;
        public uint PrimitiveRestartIndex;

        public GalPipelineState()
        {
            ConstBufferKeys = new long[Stages][];

            for (int Stage = 0; Stage < Stages; Stage++)
            {
                ConstBufferKeys[Stage] = new long[ConstBuffersPerStage];
            }
        }
    }
}