aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/SamplerCreateInfo.cs
blob: 2374a0662384e1b5a3ebf99c14193c866cfbdc9f (plain) (blame)
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
namespace Ryujinx.Graphics.GAL
{
    public readonly struct SamplerCreateInfo
    {
        public MinFilter MinFilter { get; }
        public MagFilter MagFilter { get; }

        public bool SeamlessCubemap { get; }

        public AddressMode AddressU { get; }
        public AddressMode AddressV { get; }
        public AddressMode AddressP { get; }

        public CompareMode CompareMode { get; }
        public CompareOp CompareOp { get; }

        public ColorF BorderColor { get; }

        public float MinLod { get; }
        public float MaxLod { get; }
        public float MipLodBias { get; }
        public float MaxAnisotropy { get; }

        public SamplerCreateInfo(
            MinFilter minFilter,
            MagFilter magFilter,
            bool seamlessCubemap,
            AddressMode addressU,
            AddressMode addressV,
            AddressMode addressP,
            CompareMode compareMode,
            CompareOp compareOp,
            ColorF borderColor,
            float minLod,
            float maxLod,
            float mipLodBias,
            float maxAnisotropy)
        {
            MinFilter = minFilter;
            MagFilter = magFilter;
            SeamlessCubemap = seamlessCubemap;
            AddressU = addressU;
            AddressV = addressV;
            AddressP = addressP;
            CompareMode = compareMode;
            CompareOp = compareOp;
            BorderColor = borderColor;
            MinLod = minLod;
            MaxLod = maxLod;
            MipLodBias = mipLodBias;
            MaxAnisotropy = maxAnisotropy;
        }

        public static SamplerCreateInfo Create(MinFilter minFilter, MagFilter magFilter)
        {
            return new SamplerCreateInfo(
                minFilter,
                magFilter,
                false,
                AddressMode.ClampToEdge,
                AddressMode.ClampToEdge,
                AddressMode.ClampToEdge,
                CompareMode.None,
                CompareOp.Always,
                new ColorF(0f, 0f, 0f, 0f),
                0f,
                0f,
                0f,
                1f);
        }
    }
}