aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Shader/Decoders/OpCodeTexture.cs
blob: 7a7e8f46e7c82b83e3f2833529581f009dcdf31e (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
using Ryujinx.Graphics.Shader.Instructions;

namespace Ryujinx.Graphics.Shader.Decoders
{
    class OpCodeTexture : OpCode
    {
        public Register Rd { get; }
        public Register Ra { get; }
        public Register Rb { get; }

        public bool IsArray { get; }

        public TextureDimensions Dimensions { get; }

        public int ComponentMask { get; }

        public int Immediate { get; }

        public TextureLodMode LodMode { get; protected set; }

        public bool HasOffset       { get; protected set; }
        public bool HasDepthCompare { get; protected set; }
        public bool IsMultisample   { get; protected set; }

        public OpCodeTexture(InstEmitter emitter, ulong address, long opCode) : base(emitter, address, opCode)
        {
            Rd = new Register(opCode.Extract(0,  8), RegisterType.Gpr);
            Ra = new Register(opCode.Extract(8,  8), RegisterType.Gpr);
            Rb = new Register(opCode.Extract(20, 8), RegisterType.Gpr);

            IsArray = opCode.Extract(28);

            Dimensions = (TextureDimensions)opCode.Extract(29, 2);

            ComponentMask = opCode.Extract(31, 4);

            Immediate = opCode.Extract(36, 13);

            LodMode = (TextureLodMode)opCode.Extract(55, 3);
        }
    }
}