aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClassState.cs
blob: 35051c6e03f722934ec7962d822fcbd31d90f950 (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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
using Ryujinx.Common.Memory;
using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu.Engine.InlineToMemory;
using Ryujinx.Graphics.Gpu.Engine.Types;
using Ryujinx.Graphics.Gpu.Image;
using Ryujinx.Graphics.Shader;
using System;
using System.Runtime.CompilerServices;

namespace Ryujinx.Graphics.Gpu.Engine.Threed
{
    /// <summary>
    /// Shader stage name.
    /// </summary>
    enum ShaderType
    {
        Vertex,
        TessellationControl,
        TessellationEvaluation,
        Geometry,
        Fragment,
    }

    /// <summary>
    /// Tessellation mode.
    /// </summary>
    struct TessMode
    {
#pragma warning disable CS0649 // Field is never assigned to
        public uint Packed;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks the tessellation abstract patch type.
        /// </summary>
        /// <returns>Abtract patch type</returns>
        public readonly TessPatchType UnpackPatchType()
        {
            return (TessPatchType)(Packed & 3);
        }

        /// <summary>
        /// Unpacks the spacing between tessellated vertices of the patch.
        /// </summary>
        /// <returns>Spacing between tessellated vertices</returns>
        public readonly TessSpacing UnpackSpacing()
        {
            return (TessSpacing)((Packed >> 4) & 3);
        }

        /// <summary>
        /// Unpacks the primitive winding order.
        /// </summary>
        /// <returns>True if clockwise, false if counter-clockwise</returns>
        public readonly bool UnpackCw()
        {
            return (Packed & (1 << 8)) != 0;
        }
    }

    /// <summary>
    /// Transform feedback buffer state.
    /// </summary>
    struct TfBufferState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 Enable;
        public GpuVa Address;
        public int Size;
        public int Offset;
        public uint Padding0;
        public uint Padding1;
        public uint Padding2;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Transform feedback state.
    /// </summary>
    struct TfState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public int BufferIndex;
        public int VaryingsCount;
        public int Stride;
        public uint Padding;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Render target color buffer state.
    /// </summary>
    struct RtColorState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public GpuVa Address;
        public int WidthOrStride;
        public int Height;
        public ColorFormat Format;
        public MemoryLayout MemoryLayout;
        public int Depth;
        public int LayerSize;
        public int BaseLayer;
        public int Unknown0x24;
        public int Padding0;
        public int Padding1;
        public int Padding2;
        public int Padding3;
        public int Padding4;
        public int Padding5;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Viewport transform parameters, for viewport transformation.
    /// </summary>
    struct ViewportTransform
    {
#pragma warning disable CS0649 // Field is never assigned to
        public float ScaleX;
        public float ScaleY;
        public float ScaleZ;
        public float TranslateX;
        public float TranslateY;
        public float TranslateZ;
        public uint Swizzle;
        public uint SubpixelPrecisionBias;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks viewport swizzle of the position X component.
        /// </summary>
        /// <returns>Swizzle enum value</returns>
        public readonly ViewportSwizzle UnpackSwizzleX()
        {
            return (ViewportSwizzle)(Swizzle & 7);
        }

        /// <summary>
        /// Unpacks viewport swizzle of the position Y component.
        /// </summary>
        /// <returns>Swizzle enum value</returns>
        public readonly ViewportSwizzle UnpackSwizzleY()
        {
            return (ViewportSwizzle)((Swizzle >> 4) & 7);
        }

        /// <summary>
        /// Unpacks viewport swizzle of the position Z component.
        /// </summary>
        /// <returns>Swizzle enum value</returns>
        public readonly ViewportSwizzle UnpackSwizzleZ()
        {
            return (ViewportSwizzle)((Swizzle >> 8) & 7);
        }

        /// <summary>
        /// Unpacks viewport swizzle of the position W component.
        /// </summary>
        /// <returns>Swizzle enum value</returns>
        public readonly ViewportSwizzle UnpackSwizzleW()
        {
            return (ViewportSwizzle)((Swizzle >> 12) & 7);
        }
    }

    /// <summary>
    /// Viewport extents for viewport clipping, also includes depth range.
    /// </summary>
    struct ViewportExtents
    {
#pragma warning disable CS0649 // Field is never assigned to
        public ushort X;
        public ushort Width;
        public ushort Y;
        public ushort Height;
        public float DepthNear;
        public float DepthFar;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Draw state for non-indexed draws.
    /// </summary>
    struct VertexBufferDrawState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public int First;
        public int Count;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Color buffer clear color.
    /// </summary>
    struct ClearColors
    {
#pragma warning disable CS0649 // Field is never assigned to
        public float Red;
        public float Green;
        public float Blue;
        public float Alpha;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Depth bias (also called polygon offset) parameters.
    /// </summary>
    struct DepthBiasState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 PointEnable;
        public Boolean32 LineEnable;
        public Boolean32 FillEnable;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Indicates whenever the blend microcode processes RGB and alpha components.
    /// </summary>
    enum BlendUcodeEnable
    {
        Disabled = 0,
        EnableRGB = 1,
        EnableAlpha = 2,
        EnableRGBA = 3,
    }

    /// <summary>
    /// Scissor state.
    /// </summary>
    struct ScissorState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 Enable;
        public ushort X1;
        public ushort X2;
        public ushort Y1;
        public ushort Y2;
        public uint Padding;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Stencil test masks for back tests.
    /// </summary>
    struct StencilBackMasks
    {
#pragma warning disable CS0649 // Field is never assigned to
        public int FuncRef;
        public int Mask;
        public int FuncMask;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Render target depth-stencil buffer state.
    /// </summary>
    struct RtDepthStencilState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public GpuVa Address;
        public ZetaFormat Format;
        public MemoryLayout MemoryLayout;
        public int LayerSize;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Screen scissor state.
    /// </summary>
    struct ScreenScissorState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public ushort X;
        public ushort Width;
        public ushort Y;
        public ushort Height;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Vertex attribute vector and component size.
    /// </summary>
    enum VertexAttribSize
    {
        Size32x4 = 1,
        Size32x3 = 2,
        Size16x4 = 3,
        Size32x2 = 4,
        Size16x3 = 5,
        Size8x4 = 0xa,
        Size16x2 = 0xf,
        Size32 = 0x12,
        Size8x3 = 0x13,
        Size8x2 = 0x18,
        Size16 = 0x1b,
        Size8 = 0x1d,
        Rgb10A2 = 0x30,
        Rg11B10 = 0x31,
    }

    /// <summary>
    /// Vertex attribute component type.
    /// </summary>
    enum VertexAttribType
    {
        Snorm = 1,
        Unorm = 2,
        Sint = 3,
        Uint = 4,
        Uscaled = 5,
        Sscaled = 6,
        Float = 7,
    }

    /// <summary>
    /// Vertex buffer attribute state.
    /// </summary>
    struct VertexAttribState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public uint Attribute;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks the index of the vertex buffer this attribute belongs to.
        /// </summary>
        /// <returns>Vertex buffer index</returns>
        public readonly int UnpackBufferIndex()
        {
            return (int)(Attribute & 0x1f);
        }

        /// <summary>
        /// Unpacks the attribute constant flag.
        /// </summary>
        /// <returns>True if the attribute is constant, false otherwise</returns>
        public readonly bool UnpackIsConstant()
        {
            return (Attribute & 0x40) != 0;
        }

        /// <summary>
        /// Unpacks the offset, in bytes, of the attribute on the vertex buffer.
        /// </summary>
        /// <returns>Attribute offset in bytes</returns>
        public readonly int UnpackOffset()
        {
            return (int)((Attribute >> 7) & 0x3fff);
        }

        /// <summary>
        /// Unpacks the Maxwell attribute format integer.
        /// </summary>
        /// <returns>Attribute format integer</returns>
        public readonly uint UnpackFormat()
        {
            return Attribute & 0x3fe00000;
        }

        /// <summary>
        /// Unpacks the Maxwell attribute size.
        /// </summary>
        /// <returns>Attribute size</returns>
        public readonly VertexAttribSize UnpackSize()
        {
            return (VertexAttribSize)((Attribute >> 21) & 0x3f);
        }

        /// <summary>
        /// Unpacks the Maxwell attribute component type.
        /// </summary>
        /// <returns>Attribute component type</returns>
        public readonly VertexAttribType UnpackType()
        {
            return (VertexAttribType)((Attribute >> 27) & 7);
        }
    }

    /// <summary>
    /// Render target draw buffers control.
    /// </summary>
    struct RtControl
    {
#pragma warning disable CS0649 // Field is never assigned to
        public uint Packed;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks the number of active draw buffers.
        /// </summary>
        /// <returns>Number of active draw buffers</returns>
        public readonly int UnpackCount()
        {
            return (int)(Packed & 0xf);
        }

        /// <summary>
        /// Unpacks the color attachment index for a given draw buffer.
        /// </summary>
        /// <param name="index">Index of the draw buffer</param>
        /// <returns>Attachment index</returns>
        public readonly int UnpackPermutationIndex(int index)
        {
            return (int)((Packed >> (4 + index * 3)) & 7);
        }
    }

    /// <summary>
    /// 3D, 2D or 1D texture size.
    /// </summary>
    struct Size3D
    {
#pragma warning disable CS0649 // Field is never assigned to
        public int Width;
        public int Height;
        public ushort Depth;
        public ushort Flags;

        public readonly bool UnpackIsLayered()
        {
            return (Flags & 1) == 0;
        }
#pragma warning restore CS0649
    }

    /// <summary>
    /// Stencil front test state and masks.
    /// </summary>
    struct StencilTestState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 Enable;
        public StencilOp FrontSFail;
        public StencilOp FrontDpFail;
        public StencilOp FrontDpPass;
        public CompareOp FrontFunc;
        public int FrontFuncRef;
        public int FrontFuncMask;
        public int FrontMask;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Screen Y control register.
    /// </summary>
    [Flags]
    enum YControl
    {
        NegateY = 1 << 0,
        TriangleRastFlip = 1 << 4,
    }

    /// <summary>
    /// RGB color components packed as 16-bit float values.
    /// </summary>
    struct RgbHalf
    {
#pragma warning disable CS0649 // Field is never assigned to
        public uint R;
        public uint G;
        public uint B;
        public uint Padding;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks the red color component as a 16-bit float value.
        /// </summary>
        /// <returns>The component value</returns>
        public readonly Half UnpackR()
        {
            ushort value = (ushort)R;
            return Unsafe.As<ushort, Half>(ref value);
        }

        /// <summary>
        /// Unpacks the green color component as a 16-bit float value.
        /// </summary>
        /// <returns>The component value</returns>
        public readonly Half UnpackG()
        {
            ushort value = (ushort)G;
            return Unsafe.As<ushort, Half>(ref value);
        }

        /// <summary>
        /// Unpacks the blue color component as a 16-bit float value.
        /// </summary>
        /// <returns>The component value</returns>
        public readonly Half UnpackB()
        {
            ushort value = (ushort)B;
            return Unsafe.As<ushort, Half>(ref value);
        }
    }

    /// <summary>
    /// Condition for conditional rendering.
    /// </summary>
    enum Condition
    {
        Never,
        Always,
        ResultNonZero,
        Equal,
        NotEqual,
    }

    /// <summary>
    /// Texture or sampler pool state.
    /// </summary>
    struct PoolState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public GpuVa Address;
        public int MaximumId;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Stencil back test state.
    /// </summary>
    struct StencilBackTestState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 TwoSided;
        public StencilOp BackSFail;
        public StencilOp BackDpFail;
        public StencilOp BackDpPass;
        public CompareOp BackFunc;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Primitive restart state.
    /// </summary>
    struct PrimitiveRestartState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 Enable;
        public int Index;
#pragma warning restore CS0649
    }

    /// <summary>
    /// GPU index buffer state.
    /// This is used on indexed draws.
    /// </summary>
    struct IndexBufferState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public GpuVa Address;
        public GpuVa EndAddress;
        public IndexType Type;
        public int First;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Face culling and orientation parameters.
    /// </summary>
    struct FaceState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 CullEnable;
        public FrontFace FrontFace;
        public Face CullFace;
#pragma warning restore CS0649
    }

    /// <summary>
    /// View volume clip control.
    /// </summary>
    [Flags]
    enum ViewVolumeClipControl
    {
        ForceDepthRangeZeroToOne = 1 << 0,
        DepthClampDisabled = 1 << 11,
    }

    /// <summary>
    /// Logical operation state.
    /// </summary>
    struct LogicalOpState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 Enable;
        public LogicalOp LogicalOp;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Render target color buffer mask.
    /// This defines which color channels are written to the color buffer.
    /// </summary>
    struct RtColorMask
    {
        public uint Packed;

        public RtColorMask(uint packed)
        {
            Packed = packed;
        }

        /// <summary>
        /// Unpacks red channel enable.
        /// </summary>
        /// <returns>True to write the new red channel color, false to keep the old value</returns>
        public readonly bool UnpackRed()
        {
            return (Packed & 0x1) != 0;
        }

        /// <summary>
        /// Unpacks green channel enable.
        /// </summary>
        /// <returns>True to write the new green channel color, false to keep the old value</returns>
        public readonly bool UnpackGreen()
        {
            return (Packed & 0x10) != 0;
        }

        /// <summary>
        /// Unpacks blue channel enable.
        /// </summary>
        /// <returns>True to write the new blue channel color, false to keep the old value</returns>
        public readonly bool UnpackBlue()
        {
            return (Packed & 0x100) != 0;
        }

        /// <summary>
        /// Unpacks alpha channel enable.
        /// </summary>
        /// <returns>True to write the new alpha channel color, false to keep the old value</returns>
        public readonly bool UnpackAlpha()
        {
            return (Packed & 0x1000) != 0;
        }
    }

    /// <summary>
    /// Vertex buffer state.
    /// </summary>
    struct VertexBufferState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public uint Control;
        public GpuVa Address;
        public int Divisor;
#pragma warning restore CS0649

        /// <summary>
        /// Vertex buffer stride, defined as the number of bytes occupied by each vertex in memory.
        /// </summary>
        /// <returns>Vertex buffer stride</returns>
        public readonly int UnpackStride()
        {
            return (int)(Control & 0xfff);
        }

        /// <summary>
        /// Vertex buffer enable.
        /// </summary>
        /// <returns>True if the vertex buffer is enabled, false otherwise</returns>
        public readonly bool UnpackEnable()
        {
            return (Control & (1 << 12)) != 0;
        }
    }

    /// <summary>
    /// Color buffer blending parameters, shared by all color buffers.
    /// </summary>
    struct BlendStateCommon
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 SeparateAlpha;
        public BlendOp ColorOp;
        public BlendFactor ColorSrcFactor;
        public BlendFactor ColorDstFactor;
        public BlendOp AlphaOp;
        public BlendFactor AlphaSrcFactor;
        public uint Unknown0x1354;
        public BlendFactor AlphaDstFactor;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Color buffer blending parameters.
    /// </summary>
    struct BlendState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public Boolean32 SeparateAlpha;
        public BlendOp ColorOp;
        public BlendFactor ColorSrcFactor;
        public BlendFactor ColorDstFactor;
        public BlendOp AlphaOp;
        public BlendFactor AlphaSrcFactor;
        public BlendFactor AlphaDstFactor;
        public uint Padding;
#pragma warning restore CS0649
    }

    /// <summary>
    /// Graphics shader stage state.
    /// </summary>
    struct ShaderState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public uint Control;
        public uint Offset;
        public uint Unknown0x8;
        public int MaxRegisters;
        public ShaderType Type;
        public uint Unknown0x14;
        public uint Unknown0x18;
        public uint Unknown0x1c;
        public uint Unknown0x20;
        public uint Unknown0x24;
        public uint Unknown0x28;
        public uint Unknown0x2c;
        public uint Unknown0x30;
        public uint Unknown0x34;
        public uint Unknown0x38;
        public uint Unknown0x3c;
#pragma warning restore CS0649

        /// <summary>
        /// Unpacks shader enable information.
        /// Must be ignored for vertex shaders, those are always enabled.
        /// </summary>
        /// <returns>True if the stage is enabled, false otherwise</returns>
        public readonly bool UnpackEnable()
        {
            return (Control & 1) != 0;
        }
    }

    /// <summary>
    /// Uniform buffer state for the uniform buffer currently being modified.
    /// </summary>
    struct UniformBufferState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public int Size;
        public GpuVa Address;
        public int Offset;
#pragma warning restore CS0649
    }

    unsafe struct ThreedClassState : IShadowState
    {
#pragma warning disable CS0649 // Field is never assigned to
        public uint SetObject;
        public readonly int SetObjectClassId => (int)(SetObject & 0xFFFF);
        public readonly int SetObjectEngineId => (int)((SetObject >> 16) & 0x1F);
        public fixed uint Reserved04[63];
        public uint NoOperation;
        public uint SetNotifyA;
        public readonly int SetNotifyAAddressUpper => (int)(SetNotifyA & 0xFF);
        public uint SetNotifyB;
        public uint Notify;
        public readonly NotifyType NotifyType => (NotifyType)(Notify);
        public uint WaitForIdle;
        public uint LoadMmeInstructionRamPointer;
        public uint LoadMmeInstructionRam;
        public uint LoadMmeStartAddressRamPointer;
        public uint LoadMmeStartAddressRam;
        public uint SetMmeShadowRamControl;
        public readonly SetMmeShadowRamControlMode SetMmeShadowRamControlMode => (SetMmeShadowRamControlMode)(SetMmeShadowRamControl & 0x3);
        public fixed uint Reserved128[2];
        public uint SetGlobalRenderEnableA;
        public readonly int SetGlobalRenderEnableAOffsetUpper => (int)(SetGlobalRenderEnableA & 0xFF);
        public uint SetGlobalRenderEnableB;
        public uint SetGlobalRenderEnableC;
        public readonly int SetGlobalRenderEnableCMode => (int)(SetGlobalRenderEnableC & 0x7);
        public uint SendGoIdle;
        public uint PmTrigger;
        public uint PmTriggerWfi;
        public fixed uint Reserved148[2];
        public uint SetInstrumentationMethodHeader;
        public uint SetInstrumentationMethodData;
        public fixed uint Reserved158[10];
        public uint LineLengthIn;
        public uint LineCount;
        public uint OffsetOutUpper;
        public readonly int OffsetOutUpperValue => (int)(OffsetOutUpper & 0xFF);
        public uint OffsetOut;
        public uint PitchOut;
        public uint SetDstBlockSize;
        public readonly SetDstBlockSizeWidth SetDstBlockSizeWidth => (SetDstBlockSizeWidth)(SetDstBlockSize & 0xF);
        public readonly SetDstBlockSizeHeight SetDstBlockSizeHeight => (SetDstBlockSizeHeight)((SetDstBlockSize >> 4) & 0xF);
        public readonly SetDstBlockSizeDepth SetDstBlockSizeDepth => (SetDstBlockSizeDepth)((SetDstBlockSize >> 8) & 0xF);
        public uint SetDstWidth;
        public uint SetDstHeight;
        public uint SetDstDepth;
        public uint SetDstLayer;
        public uint SetDstOriginBytesX;
        public readonly int SetDstOriginBytesXV => (int)(SetDstOriginBytesX & 0xFFFFF);
        public uint SetDstOriginSamplesY;
        public readonly int SetDstOriginSamplesYV => (int)(SetDstOriginSamplesY & 0xFFFF);
        public uint LaunchDma;
        public readonly LaunchDmaDstMemoryLayout LaunchDmaDstMemoryLayout => (LaunchDmaDstMemoryLayout)(LaunchDma & 0x1);
        public readonly LaunchDmaCompletionType LaunchDmaCompletionType => (LaunchDmaCompletionType)((LaunchDma >> 4) & 0x3);
        public readonly LaunchDmaInterruptType LaunchDmaInterruptType => (LaunchDmaInterruptType)((LaunchDma >> 8) & 0x3);
        public readonly LaunchDmaSemaphoreStructSize LaunchDmaSemaphoreStructSize => (LaunchDmaSemaphoreStructSize)((LaunchDma >> 12) & 0x1);
        public readonly bool LaunchDmaReductionEnable => (LaunchDma & 0x2) != 0;
        public readonly LaunchDmaReductionOp LaunchDmaReductionOp => (LaunchDmaReductionOp)((LaunchDma >> 13) & 0x7);
        public readonly LaunchDmaReductionFormat LaunchDmaReductionFormat => (LaunchDmaReductionFormat)((LaunchDma >> 2) & 0x3);
        public readonly bool LaunchDmaSysmembarDisable => (LaunchDma & 0x40) != 0;
        public uint LoadInlineData;
        public fixed uint Reserved1B8[22];
        public Boolean32 EarlyZForce;
        public fixed uint Reserved214[45];
        public uint SyncpointAction;
        public fixed uint Reserved2CC[10];
        public uint BlendUcodeNormalizedDst;
        public fixed uint Reserved2F8[10];
        public TessMode TessMode;
        public Array4<float> TessOuterLevel;
        public Array2<float> TessInnerLevel;
        public fixed uint Reserved33C[16];
        public Boolean32 RasterizeEnable;
        public Array4<TfBufferState> TfBufferState;
        public fixed uint Reserved400[192];
        public Array4<TfState> TfState;
        public fixed uint Reserved740[1];
        public Boolean32 TfEnable;
        public fixed uint Reserved748[46];
        public Array8<RtColorState> RtColorState;
        public Array16<ViewportTransform> ViewportTransform;
        public Array16<ViewportExtents> ViewportExtents;
        public fixed uint ReservedD00[29];
        public VertexBufferDrawState VertexBufferDrawState;
        public uint DepthMode;
        public ClearColors ClearColors;
        public float ClearDepthValue;
        public fixed uint ReservedD94[3];
        public uint ClearStencilValue;
        public fixed uint ReservedDA4[2];
        public PolygonMode PolygonModeFront;
        public PolygonMode PolygonModeBack;
        public Boolean32 PolygonSmoothEnable;
        public fixed uint ReservedDB8[2];
        public DepthBiasState DepthBiasState;
        public int PatchVertices;
        public BlendUcodeEnable BlendUcodeEnable;
        public uint BlendUcodeSize;
        public fixed uint ReservedDD8[2];
        public uint TextureBarrier;
        public uint WatchdogTimer;
        public Boolean32 PrimitiveRestartDrawArrays;
        public uint ReservedDEC;
        public uint LoadBlendUcodeStart;
        public uint LoadBlendUcodeInstruction;
        public fixed uint ReservedDF8[2];
        public Array16<ScissorState> ScissorState;
        public fixed uint ReservedF00[21];
        public StencilBackMasks StencilBackMasks;
        public fixed uint ReservedF60[5];
        public uint InvalidateTextures;
        public fixed uint ReservedF78[1];
        public uint TextureBarrierTiled;
        public fixed uint ReservedF80[4];
        public Boolean32 RtColorMaskShared;
        public fixed uint ReservedF94[19];
        public RtDepthStencilState RtDepthStencilState;
        public ScreenScissorState ScreenScissorState;
        public fixed uint ReservedFFC[33];
        public int DrawTextureDstX;
        public int DrawTextureDstY;
        public int DrawTextureDstWidth;
        public int DrawTextureDstHeight;
        public long DrawTextureDuDx;
        public long DrawTextureDvDy;
        public int DrawTextureSamplerId;
        public int DrawTextureTextureId;
        public int DrawTextureSrcX;
        public int DrawTextureSrcY;
        public fixed uint Reserved10B0[18];
        public uint ClearFlags;
        public fixed uint Reserved10FC[25];
        public Array32<VertexAttribState> VertexAttribState;
        public fixed uint Reserved11E0[13];
        public uint DrawVertexArrayBeginEndInstanceFirst;
        public uint DrawVertexArrayBeginEndInstanceSubsequent;
        public RtControl RtControl;
        public fixed uint Reserved1220[2];
        public Size3D RtDepthStencilSize;
        public SamplerIndex SamplerIndex;
        public fixed uint Reserved1238[37];
        public Boolean32 DepthTestEnable;
        public fixed uint Reserved12D0[4];
        public Boolean32 AlphaToCoverageDitherEnable;
        public Boolean32 BlendIndependent;
        public Boolean32 DepthWriteEnable;
        public Boolean32 AlphaTestEnable;
        public fixed uint Reserved12F0[5];
        public uint VbElementU8;
        public uint Reserved1308;
        public CompareOp DepthTestFunc;
        public float AlphaTestRef;
        public CompareOp AlphaTestFunc;
        public uint Reserved1318;
        public ColorF BlendConstant;
        public fixed uint Reserved132C[4];
        public BlendStateCommon BlendStateCommon;
        public Boolean32 BlendEnableCommon;
        public Array8<Boolean32> BlendEnable;
        public StencilTestState StencilTestState;
        public fixed uint Reserved13A0[3];
        public YControl YControl;
        public float LineWidthSmooth;
        public float LineWidthAliased;
        public fixed uint Reserved13B8[27];
        public uint InvalidateSamplerCacheNoWfi;
        public uint InvalidateTextureHeaderCacheNoWfi;
        public fixed uint Reserved142C[2];
        public uint FirstVertex;
        public uint FirstInstance;
        public fixed uint Reserved143C[17];
        public Array8<RgbHalf> BlendUcodeConstants;
        public fixed uint Reserved1500[4];
        public uint ClipDistanceEnable;
        public uint Reserved1514;
        public float PointSize;
        public uint Reserved151C;
        public Boolean32 PointSpriteEnable;
        public fixed uint Reserved1524[3];
        public uint ResetCounter;
        public Boolean32 MultisampleEnable;
        public Boolean32 RtDepthStencilEnable;
        public uint MultisampleControl;
        public fixed uint Reserved1540[4];
        public GpuVa RenderEnableAddress;
        public Condition RenderEnableCondition;
        public PoolState SamplerPoolState;
        public uint Reserved1568;
        public float DepthBiasFactor;
        public Boolean32 LineSmoothEnable;
        public PoolState TexturePoolState;
        public fixed uint Reserved1580[5];
        public StencilBackTestState StencilBackTestState;
        public fixed uint Reserved15A8[5];
        public float DepthBiasUnits;
        public fixed uint Reserved15C0[4];
        public TextureMsaaMode RtMsaaMode;
        public fixed uint Reserved15D4[5];
        public uint VbElementU32;
        public uint Reserved15EC;
        public uint VbElementU16;
        public fixed uint Reserved15F4[4];
        public uint PointCoordReplace;
        public GpuVa ShaderBaseAddress;
        public uint Reserved1610;
        public uint DrawEnd;
        public uint DrawBegin;
        public fixed uint Reserved161C[10];
        public PrimitiveRestartState PrimitiveRestartState;
        public fixed uint Reserved164C[95];
        public IndexBufferState IndexBufferState;
        public uint IndexBufferCount;
        public uint DrawIndexBuffer32BeginEndInstanceFirst;
        public uint DrawIndexBuffer16BeginEndInstanceFirst;
        public uint DrawIndexBuffer8BeginEndInstanceFirst;
        public uint DrawIndexBuffer32BeginEndInstanceSubsequent;
        public uint DrawIndexBuffer16BeginEndInstanceSubsequent;
        public uint DrawIndexBuffer8BeginEndInstanceSubsequent;
        public fixed uint Reserved17FC[32];
        public float DepthBiasClamp;
        public Array16<Boolean32> VertexBufferInstanced;
        public fixed uint Reserved18C0[20];
        public Boolean32 VertexProgramPointSize;
        public uint Reserved1914;
        public FaceState FaceState;
        public fixed uint Reserved1924[2];
        public uint ViewportTransformEnable;
        public fixed uint Reserved1930[3];
        public ViewVolumeClipControl ViewVolumeClipControl;
        public fixed uint Reserved1940[2];
        public Boolean32 PrimitiveTypeOverrideEnable;
        public fixed uint Reserved194C[9];
        public PrimitiveTypeOverride PrimitiveTypeOverride;
        public fixed uint Reserved1974[20];
        public LogicalOpState LogicOpState;
        public uint Reserved19CC;
        public uint Clear;
        public fixed uint Reserved19D4[11];
        public Array8<RtColorMask> RtColorMask;
        public fixed uint Reserved1A20[56];
        public GpuVa SemaphoreAddress;
        public int SemaphorePayload;
        public uint SemaphoreControl;
        public fixed uint Reserved1B10[60];
        public Array16<VertexBufferState> VertexBufferState;
        public fixed uint Reserved1D00[64];
        public Array8<BlendState> BlendState;
        public Array16<GpuVa> VertexBufferEndAddress;
        public fixed uint Reserved1F80[32];
        public Array6<ShaderState> ShaderState;
        public fixed uint Reserved2180[96];
        public uint SetFalcon00;
        public uint SetFalcon01;
        public uint SetFalcon02;
        public uint SetFalcon03;
        public uint SetFalcon04;
        public uint SetFalcon05;
        public uint SetFalcon06;
        public uint SetFalcon07;
        public uint SetFalcon08;
        public uint SetFalcon09;
        public uint SetFalcon10;
        public uint SetFalcon11;
        public uint SetFalcon12;
        public uint SetFalcon13;
        public uint SetFalcon14;
        public uint SetFalcon15;
        public uint SetFalcon16;
        public uint SetFalcon17;
        public uint SetFalcon18;
        public uint SetFalcon19;
        public uint SetFalcon20;
        public uint SetFalcon21;
        public uint SetFalcon22;
        public uint SetFalcon23;
        public uint SetFalcon24;
        public uint SetFalcon25;
        public uint SetFalcon26;
        public uint SetFalcon27;
        public uint SetFalcon28;
        public uint SetFalcon29;
        public uint SetFalcon30;
        public uint SetFalcon31;
        public UniformBufferState UniformBufferState;
        public Array16<uint> UniformBufferUpdateData;
        public fixed uint Reserved23D0[16];
        public uint UniformBufferBindVertex;
        public fixed uint Reserved2414[7];
        public uint UniformBufferBindTessControl;
        public fixed uint Reserved2434[7];
        public uint UniformBufferBindTessEvaluation;
        public fixed uint Reserved2454[7];
        public uint UniformBufferBindGeometry;
        public fixed uint Reserved2474[7];
        public uint UniformBufferBindFragment;
        public fixed uint Reserved2494[93];
        public uint TextureBufferIndex;
        public fixed uint Reserved260C[125];
        public Array4<Array32<uint>> TfVaryingLocations;
        public fixed uint Reserved2A00[640];
        public Array256<uint> SetMmeShadowScratch;
#pragma warning restore CS0649
    }
}