aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Engine/Dma/DmaClassState.cs
blob: f258c0070c088275f7a82dc481d8985d1ba519ec (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
// This file was auto-generated from NVIDIA official Maxwell definitions.

namespace Ryujinx.Graphics.Gpu.Engine.Dma
{
    /// <summary>
    /// Physical mode target.
    /// </summary>
    enum SetPhysModeTarget
    {
        LocalFb = 0,
        CoherentSysmem = 1,
        NoncoherentSysmem = 2,
    }

    /// <summary>
    /// DMA data transfer type.
    /// </summary>
    enum LaunchDmaDataTransferType
    {
        None = 0,
        Pipelined = 1,
        NonPipelined = 2,
    }

    /// <summary>
    /// DMA semaphore type.
    /// </summary>
    enum LaunchDmaSemaphoreType
    {
        None = 0,
        ReleaseOneWordSemaphore = 1,
        ReleaseFourWordSemaphore = 2,
    }

    /// <summary>
    /// DMA interrupt type.
    /// </summary>
    enum LaunchDmaInterruptType
    {
        None = 0,
        Blocking = 1,
        NonBlocking = 2,
    }

    /// <summary>
    /// DMA destination memory layout.
    /// </summary>
    enum LaunchDmaMemoryLayout
    {
        Blocklinear = 0,
        Pitch = 1,
    }

    /// <summary>
    /// DMA type.
    /// </summary>
    enum LaunchDmaType
    {
        Virtual = 0,
        Physical = 1,
    }

    /// <summary>
    /// DMA semaphore reduction operation.
    /// </summary>
    enum LaunchDmaSemaphoreReduction
    {
        Imin = 0,
        Imax = 1,
        Ixor = 2,
        Iand = 3,
        Ior = 4,
        Iadd = 5,
        Inc = 6,
        Dec = 7,
        Fadd = 10,
    }

    /// <summary>
    /// DMA semaphore reduction signedness.
    /// </summary>
    enum LaunchDmaSemaphoreReductionSign
    {
        Signed = 0,
        Unsigned = 1,
    }

    /// <summary>
    /// DMA L2 cache bypass.
    /// </summary>
    enum LaunchDmaBypassL2
    {
        UsePteSetting = 0,
        ForceVolatile = 1,
    }

    /// <summary>
    /// DMA component remapping source component.
    /// </summary>
    enum SetRemapComponentsDst
    {
        SrcX = 0,
        SrcY = 1,
        SrcZ = 2,
        SrcW = 3,
        ConstA = 4,
        ConstB = 5,
        NoWrite = 6,
    }

    /// <summary>
    /// DMA component remapping component size.
    /// </summary>
    enum SetRemapComponentsComponentSize
    {
        One = 0,
        Two = 1,
        Three = 2,
        Four = 3,
    }

    /// <summary>
    /// DMA component remapping number of components.
    /// </summary>
    enum SetRemapComponentsNumComponents
    {
        One = 0,
        Two = 1,
        Three = 2,
        Four = 3,
    }

    /// <summary>
    /// Width in GOBs of the destination texture.
    /// </summary>
    enum SetBlockSizeWidth
    {
        QuarterGob = 14,
        OneGob = 0,
    }

    /// <summary>
    /// Height in GOBs of the destination texture.
    /// </summary>
    enum SetBlockSizeHeight
    {
        OneGob = 0,
        TwoGobs = 1,
        FourGobs = 2,
        EightGobs = 3,
        SixteenGobs = 4,
        ThirtytwoGobs = 5,
    }

    /// <summary>
    /// Depth in GOBs of the destination texture.
    /// </summary>
    enum SetBlockSizeDepth
    {
        OneGob = 0,
        TwoGobs = 1,
        FourGobs = 2,
        EightGobs = 3,
        SixteenGobs = 4,
        ThirtytwoGobs = 5,
    }

    /// <summary>
    /// Height of a single GOB in lines.
    /// </summary>
    enum SetBlockSizeGobHeight
    {
        GobHeightTesla4 = 0,
        GobHeightFermi8 = 1,
    }

    /// <summary>
    /// DMA copy class state.
    /// </summary>
    unsafe struct DmaClassState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public fixed uint Reserved00[64];
        public uint Nop;
        public fixed uint Reserved104[15];
        public uint PmTrigger;
        public fixed uint Reserved144[63];
        public uint SetSemaphoreA;
        public readonly int SetSemaphoreAUpper => (int)(SetSemaphoreA & 0xFF);
        public uint SetSemaphoreB;
        public uint SetSemaphorePayload;
        public fixed uint Reserved24C[2];
        public uint SetRenderEnableA;
        public readonly int SetRenderEnableAUpper => (int)(SetRenderEnableA & 0xFF);
        public uint SetRenderEnableB;
        public uint SetRenderEnableC;
        public readonly int SetRenderEnableCMode => (int)(SetRenderEnableC & 0x7);
        public uint SetSrcPhysMode;
        public readonly SetPhysModeTarget SetSrcPhysModeTarget => (SetPhysModeTarget)(SetSrcPhysMode & 0x3);
        public uint SetDstPhysMode;
        public readonly SetPhysModeTarget SetDstPhysModeTarget => (SetPhysModeTarget)(SetDstPhysMode & 0x3);
        public fixed uint Reserved268[38];
        public uint LaunchDma;
        public readonly LaunchDmaDataTransferType LaunchDmaDataTransferType => (LaunchDmaDataTransferType)(LaunchDma & 0x3);
        public readonly bool LaunchDmaFlushEnable => (LaunchDma & 0x4) != 0;
        public readonly LaunchDmaSemaphoreType LaunchDmaSemaphoreType => (LaunchDmaSemaphoreType)((LaunchDma >> 3) & 0x3);
        public readonly LaunchDmaInterruptType LaunchDmaInterruptType => (LaunchDmaInterruptType)((LaunchDma >> 5) & 0x3);
        public readonly LaunchDmaMemoryLayout LaunchDmaSrcMemoryLayout => (LaunchDmaMemoryLayout)((LaunchDma >> 7) & 0x1);
        public readonly LaunchDmaMemoryLayout LaunchDmaDstMemoryLayout => (LaunchDmaMemoryLayout)((LaunchDma >> 8) & 0x1);
        public readonly bool LaunchDmaMultiLineEnable => (LaunchDma & 0x200) != 0;
        public readonly bool LaunchDmaRemapEnable => (LaunchDma & 0x400) != 0;
        public readonly bool LaunchDmaForceRmwdisable => (LaunchDma & 0x800) != 0;
        public readonly LaunchDmaType LaunchDmaSrcType => (LaunchDmaType)((LaunchDma >> 12) & 0x1);
        public readonly LaunchDmaType LaunchDmaDstType => (LaunchDmaType)((LaunchDma >> 13) & 0x1);
        public readonly LaunchDmaSemaphoreReduction LaunchDmaSemaphoreReduction => (LaunchDmaSemaphoreReduction)((LaunchDma >> 14) & 0xF);
        public readonly LaunchDmaSemaphoreReductionSign LaunchDmaSemaphoreReductionSign => (LaunchDmaSemaphoreReductionSign)((LaunchDma >> 18) & 0x1);
        public readonly bool LaunchDmaSemaphoreReductionEnable => (LaunchDma & 0x80000) != 0;
        public readonly LaunchDmaBypassL2 LaunchDmaBypassL2 => (LaunchDmaBypassL2)((LaunchDma >> 20) & 0x1);
        public fixed uint Reserved304[63];
        public uint OffsetInUpper;
        public readonly int OffsetInUpperUpper => (int)(OffsetInUpper & 0xFF);
        public uint OffsetInLower;
        public uint OffsetOutUpper;
        public readonly int OffsetOutUpperUpper => (int)(OffsetOutUpper & 0xFF);
        public uint OffsetOutLower;
        public uint PitchIn;
        public uint PitchOut;
        public uint LineLengthIn;
        public uint LineCount;
        public fixed uint Reserved420[184];
        public uint SetRemapConstA;
        public uint SetRemapConstB;
        public uint SetRemapComponents;
        public readonly SetRemapComponentsDst SetRemapComponentsDstX => (SetRemapComponentsDst)(SetRemapComponents & 0x7);
        public readonly SetRemapComponentsDst SetRemapComponentsDstY => (SetRemapComponentsDst)((SetRemapComponents >> 4) & 0x7);
        public readonly SetRemapComponentsDst SetRemapComponentsDstZ => (SetRemapComponentsDst)((SetRemapComponents >> 8) & 0x7);
        public readonly SetRemapComponentsDst SetRemapComponentsDstW => (SetRemapComponentsDst)((SetRemapComponents >> 12) & 0x7);
        public readonly SetRemapComponentsComponentSize SetRemapComponentsComponentSize => (SetRemapComponentsComponentSize)((SetRemapComponents >> 16) & 0x3);
        public readonly SetRemapComponentsNumComponents SetRemapComponentsNumSrcComponents => (SetRemapComponentsNumComponents)((SetRemapComponents >> 20) & 0x3);
        public readonly SetRemapComponentsNumComponents SetRemapComponentsNumDstComponents => (SetRemapComponentsNumComponents)((SetRemapComponents >> 24) & 0x3);
        public uint SetDstBlockSize;
        public readonly SetBlockSizeWidth SetDstBlockSizeWidth => (SetBlockSizeWidth)(SetDstBlockSize & 0xF);
        public readonly SetBlockSizeHeight SetDstBlockSizeHeight => (SetBlockSizeHeight)((SetDstBlockSize >> 4) & 0xF);
        public readonly SetBlockSizeDepth SetDstBlockSizeDepth => (SetBlockSizeDepth)((SetDstBlockSize >> 8) & 0xF);
        public readonly SetBlockSizeGobHeight SetDstBlockSizeGobHeight => (SetBlockSizeGobHeight)((SetDstBlockSize >> 12) & 0xF);
        public uint SetDstWidth;
        public uint SetDstHeight;
        public uint SetDstDepth;
        public uint SetDstLayer;
        public uint SetDstOrigin;
        public readonly int SetDstOriginX => (int)(SetDstOrigin & 0xFFFF);
        public readonly int SetDstOriginY => (int)((SetDstOrigin >> 16) & 0xFFFF);
        public uint Reserved724;
        public uint SetSrcBlockSize;
        public readonly SetBlockSizeWidth SetSrcBlockSizeWidth => (SetBlockSizeWidth)(SetSrcBlockSize & 0xF);
        public readonly SetBlockSizeHeight SetSrcBlockSizeHeight => (SetBlockSizeHeight)((SetSrcBlockSize >> 4) & 0xF);
        public readonly SetBlockSizeDepth SetSrcBlockSizeDepth => (SetBlockSizeDepth)((SetSrcBlockSize >> 8) & 0xF);
        public readonly SetBlockSizeGobHeight SetSrcBlockSizeGobHeight => (SetBlockSizeGobHeight)((SetSrcBlockSize >> 12) & 0xF);
        public uint SetSrcWidth;
        public uint SetSrcHeight;
        public uint SetSrcDepth;
        public uint SetSrcLayer;
        public uint SetSrcOrigin;
        public readonly int SetSrcOriginX => (int)(SetSrcOrigin & 0xFFFF);
        public readonly int SetSrcOriginY => (int)((SetSrcOrigin >> 16) & 0xFFFF);
        public fixed uint Reserved740[629];
        public uint PmTriggerEnd;
        public fixed uint Reserved1118[2490];
#pragma warning restore CS0649
    }
}