ThreedClassState.cs 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. using Ryujinx.Common.Memory;
  2. using Ryujinx.Graphics.GAL;
  3. using Ryujinx.Graphics.Gpu.Engine.InlineToMemory;
  4. using Ryujinx.Graphics.Gpu.Engine.Types;
  5. using Ryujinx.Graphics.Gpu.Image;
  6. using Ryujinx.Graphics.Shader;
  7. using System;
  8. namespace Ryujinx.Graphics.Gpu.Engine.Threed
  9. {
  10. /// <summary>
  11. /// Shader stage name.
  12. /// </summary>
  13. enum ShaderType
  14. {
  15. Vertex,
  16. TessellationControl,
  17. TessellationEvaluation,
  18. Geometry,
  19. Fragment
  20. }
  21. /// <summary>
  22. /// Tessellation mode.
  23. /// </summary>
  24. struct TessMode
  25. {
  26. #pragma warning disable CS0649
  27. public uint Packed;
  28. #pragma warning restore CS0649
  29. /// <summary>
  30. /// Unpacks the tessellation abstract patch type.
  31. /// </summary>
  32. /// <returns>Abtract patch type</returns>
  33. public TessPatchType UnpackPatchType()
  34. {
  35. return (TessPatchType)(Packed & 3);
  36. }
  37. /// <summary>
  38. /// Unpacks the spacing between tessellated vertices of the patch.
  39. /// </summary>
  40. /// <returns>Spacing between tessellated vertices</returns>
  41. public TessSpacing UnpackSpacing()
  42. {
  43. return (TessSpacing)((Packed >> 4) & 3);
  44. }
  45. /// <summary>
  46. /// Unpacks the primitive winding order.
  47. /// </summary>
  48. /// <returns>True if clockwise, false if counter-clockwise</returns>
  49. public bool UnpackCw()
  50. {
  51. return (Packed & (1 << 8)) != 0;
  52. }
  53. }
  54. /// <summary>
  55. /// Transform feedback buffer state.
  56. /// </summary>
  57. struct TfBufferState
  58. {
  59. #pragma warning disable CS0649
  60. public Boolean32 Enable;
  61. public GpuVa Address;
  62. public int Size;
  63. public int Offset;
  64. public uint Padding0;
  65. public uint Padding1;
  66. public uint Padding2;
  67. #pragma warning restore CS0649
  68. }
  69. /// <summary>
  70. /// Transform feedback state.
  71. /// </summary>
  72. struct TfState
  73. {
  74. #pragma warning disable CS0649
  75. public int BufferIndex;
  76. public int VaryingsCount;
  77. public int Stride;
  78. public uint Padding;
  79. #pragma warning restore CS0649
  80. }
  81. /// <summary>
  82. /// Render target color buffer state.
  83. /// </summary>
  84. struct RtColorState
  85. {
  86. #pragma warning disable CS0649
  87. public GpuVa Address;
  88. public int WidthOrStride;
  89. public int Height;
  90. public ColorFormat Format;
  91. public MemoryLayout MemoryLayout;
  92. public int Depth;
  93. public int LayerSize;
  94. public int BaseLayer;
  95. public int Unknown0x24;
  96. public int Padding0;
  97. public int Padding1;
  98. public int Padding2;
  99. public int Padding3;
  100. public int Padding4;
  101. public int Padding5;
  102. #pragma warning restore CS0649
  103. }
  104. /// <summary>
  105. /// Viewport transform parameters, for viewport transformation.
  106. /// </summary>
  107. struct ViewportTransform
  108. {
  109. #pragma warning disable CS0649
  110. public float ScaleX;
  111. public float ScaleY;
  112. public float ScaleZ;
  113. public float TranslateX;
  114. public float TranslateY;
  115. public float TranslateZ;
  116. public uint Swizzle;
  117. public uint SubpixelPrecisionBias;
  118. #pragma warning restore CS0649
  119. /// <summary>
  120. /// Unpacks viewport swizzle of the position X component.
  121. /// </summary>
  122. /// <returns>Swizzle enum value</returns>
  123. public ViewportSwizzle UnpackSwizzleX()
  124. {
  125. return (ViewportSwizzle)(Swizzle & 7);
  126. }
  127. /// <summary>
  128. /// Unpacks viewport swizzle of the position Y component.
  129. /// </summary>
  130. /// <returns>Swizzle enum value</returns>
  131. public ViewportSwizzle UnpackSwizzleY()
  132. {
  133. return (ViewportSwizzle)((Swizzle >> 4) & 7);
  134. }
  135. /// <summary>
  136. /// Unpacks viewport swizzle of the position Z component.
  137. /// </summary>
  138. /// <returns>Swizzle enum value</returns>
  139. public ViewportSwizzle UnpackSwizzleZ()
  140. {
  141. return (ViewportSwizzle)((Swizzle >> 8) & 7);
  142. }
  143. /// <summary>
  144. /// Unpacks viewport swizzle of the position W component.
  145. /// </summary>
  146. /// <returns>Swizzle enum value</returns>
  147. public ViewportSwizzle UnpackSwizzleW()
  148. {
  149. return (ViewportSwizzle)((Swizzle >> 12) & 7);
  150. }
  151. }
  152. /// <summary>
  153. /// Viewport extents for viewport clipping, also includes depth range.
  154. /// </summary>
  155. struct ViewportExtents
  156. {
  157. #pragma warning disable CS0649
  158. public ushort X;
  159. public ushort Width;
  160. public ushort Y;
  161. public ushort Height;
  162. public float DepthNear;
  163. public float DepthFar;
  164. #pragma warning restore CS0649
  165. }
  166. /// <summary>
  167. /// Draw state for non-indexed draws.
  168. /// </summary>
  169. struct VertexBufferDrawState
  170. {
  171. #pragma warning disable CS0649
  172. public int First;
  173. public int Count;
  174. #pragma warning restore CS0649
  175. }
  176. /// <summary>
  177. /// Color buffer clear color.
  178. /// </summary>
  179. struct ClearColors
  180. {
  181. #pragma warning disable CS0649
  182. public float Red;
  183. public float Green;
  184. public float Blue;
  185. public float Alpha;
  186. #pragma warning restore CS0649
  187. }
  188. /// <summary>
  189. /// Depth bias (also called polygon offset) parameters.
  190. /// </summary>
  191. struct DepthBiasState
  192. {
  193. #pragma warning disable CS0649
  194. public Boolean32 PointEnable;
  195. public Boolean32 LineEnable;
  196. public Boolean32 FillEnable;
  197. #pragma warning restore CS0649
  198. }
  199. /// <summary>
  200. /// Scissor state.
  201. /// </summary>
  202. struct ScissorState
  203. {
  204. #pragma warning disable CS0649
  205. public Boolean32 Enable;
  206. public ushort X1;
  207. public ushort X2;
  208. public ushort Y1;
  209. public ushort Y2;
  210. public uint Padding;
  211. #pragma warning restore CS0649
  212. }
  213. /// <summary>
  214. /// Stencil test masks for back tests.
  215. /// </summary>
  216. struct StencilBackMasks
  217. {
  218. #pragma warning disable CS0649
  219. public int FuncRef;
  220. public int Mask;
  221. public int FuncMask;
  222. #pragma warning restore CS0649
  223. }
  224. /// <summary>
  225. /// Render target depth-stencil buffer state.
  226. /// </summary>
  227. struct RtDepthStencilState
  228. {
  229. #pragma warning disable CS0649
  230. public GpuVa Address;
  231. public ZetaFormat Format;
  232. public MemoryLayout MemoryLayout;
  233. public int LayerSize;
  234. #pragma warning restore CS0649
  235. }
  236. /// <summary>
  237. /// Screen scissor state.
  238. /// </summary>
  239. struct ScreenScissorState
  240. {
  241. #pragma warning disable CS0649
  242. public ushort X;
  243. public ushort Width;
  244. public ushort Y;
  245. public ushort Height;
  246. #pragma warning restore CS0649
  247. }
  248. /// <summary>
  249. /// Vertex buffer attribute state.
  250. /// </summary>
  251. struct VertexAttribState
  252. {
  253. #pragma warning disable CS0649
  254. public uint Attribute;
  255. #pragma warning restore CS0649
  256. /// <summary>
  257. /// Unpacks the index of the vertex buffer this attribute belongs to.
  258. /// </summary>
  259. /// <returns>Vertex buffer index</returns>
  260. public int UnpackBufferIndex()
  261. {
  262. return (int)(Attribute & 0x1f);
  263. }
  264. /// <summary>
  265. /// Unpacks the attribute constant flag.
  266. /// </summary>
  267. /// <returns>True if the attribute is constant, false otherwise</returns>
  268. public bool UnpackIsConstant()
  269. {
  270. return (Attribute & 0x40) != 0;
  271. }
  272. /// <summary>
  273. /// Unpacks the offset, in bytes, of the attribute on the vertex buffer.
  274. /// </summary>
  275. /// <returns>Attribute offset in bytes</returns>
  276. public int UnpackOffset()
  277. {
  278. return (int)((Attribute >> 7) & 0x3fff);
  279. }
  280. /// <summary>
  281. /// Unpacks the Maxwell attribute format integer.
  282. /// </summary>
  283. /// <returns>Attribute format integer</returns>
  284. public uint UnpackFormat()
  285. {
  286. return Attribute & 0x3fe00000;
  287. }
  288. /// <summary>
  289. /// Unpacks the Maxwell attribute component type.
  290. /// </summary>
  291. /// <returns>Attribute component type</returns>
  292. public uint UnpackType()
  293. {
  294. return (Attribute >> 27) & 7;
  295. }
  296. }
  297. /// <summary>
  298. /// Render target draw buffers control.
  299. /// </summary>
  300. struct RtControl
  301. {
  302. #pragma warning disable CS0649
  303. public uint Packed;
  304. #pragma warning restore CS0649
  305. /// <summary>
  306. /// Unpacks the number of active draw buffers.
  307. /// </summary>
  308. /// <returns>Number of active draw buffers</returns>
  309. public int UnpackCount()
  310. {
  311. return (int)(Packed & 0xf);
  312. }
  313. /// <summary>
  314. /// Unpacks the color attachment index for a given draw buffer.
  315. /// </summary>
  316. /// <param name="index">Index of the draw buffer</param>
  317. /// <returns>Attachment index</returns>
  318. public int UnpackPermutationIndex(int index)
  319. {
  320. return (int)((Packed >> (4 + index * 3)) & 7);
  321. }
  322. }
  323. /// <summary>
  324. /// 3D, 2D or 1D texture size.
  325. /// </summary>
  326. struct Size3D
  327. {
  328. #pragma warning disable CS0649
  329. public int Width;
  330. public int Height;
  331. public int Depth;
  332. #pragma warning restore CS0649
  333. }
  334. /// <summary>
  335. /// Stencil front test state and masks.
  336. /// </summary>
  337. struct StencilTestState
  338. {
  339. #pragma warning disable CS0649
  340. public Boolean32 Enable;
  341. public StencilOp FrontSFail;
  342. public StencilOp FrontDpFail;
  343. public StencilOp FrontDpPass;
  344. public CompareOp FrontFunc;
  345. public int FrontFuncRef;
  346. public int FrontFuncMask;
  347. public int FrontMask;
  348. #pragma warning restore CS0649
  349. }
  350. /// <summary>
  351. /// Screen Y control register.
  352. /// </summary>
  353. [Flags]
  354. enum YControl
  355. {
  356. NegateY = 1 << 0,
  357. TriangleRastFlip = 1 << 4
  358. }
  359. /// <summary>
  360. /// Condition for conditional rendering.
  361. /// </summary>
  362. enum Condition
  363. {
  364. Never,
  365. Always,
  366. ResultNonZero,
  367. Equal,
  368. NotEqual
  369. }
  370. /// <summary>
  371. /// Texture or sampler pool state.
  372. /// </summary>
  373. struct PoolState
  374. {
  375. #pragma warning disable CS0649
  376. public GpuVa Address;
  377. public int MaximumId;
  378. #pragma warning restore CS0649
  379. }
  380. /// <summary>
  381. /// Stencil back test state.
  382. /// </summary>
  383. struct StencilBackTestState
  384. {
  385. #pragma warning disable CS0649
  386. public Boolean32 TwoSided;
  387. public StencilOp BackSFail;
  388. public StencilOp BackDpFail;
  389. public StencilOp BackDpPass;
  390. public CompareOp BackFunc;
  391. #pragma warning restore CS0649
  392. }
  393. /// <summary>
  394. /// Primitive restart state.
  395. /// </summary>
  396. struct PrimitiveRestartState
  397. {
  398. #pragma warning disable CS0649
  399. public Boolean32 Enable;
  400. public int Index;
  401. #pragma warning restore CS0649
  402. }
  403. /// <summary>
  404. /// GPU index buffer state.
  405. /// This is used on indexed draws.
  406. /// </summary>
  407. struct IndexBufferState
  408. {
  409. #pragma warning disable CS0649
  410. public GpuVa Address;
  411. public GpuVa EndAddress;
  412. public IndexType Type;
  413. public int First;
  414. #pragma warning restore CS0649
  415. }
  416. /// <summary>
  417. /// Face culling and orientation parameters.
  418. /// </summary>
  419. struct FaceState
  420. {
  421. #pragma warning disable CS0649
  422. public Boolean32 CullEnable;
  423. public FrontFace FrontFace;
  424. public Face CullFace;
  425. #pragma warning restore CS0649
  426. }
  427. /// <summary>
  428. /// View volume clip control.
  429. /// </summary>
  430. [Flags]
  431. enum ViewVolumeClipControl
  432. {
  433. ForceDepthRangeZeroToOne = 1 << 0,
  434. DepthClampDisabled = 1 << 11
  435. }
  436. /// <summary>
  437. /// Logical operation state.
  438. /// </summary>
  439. struct LogicalOpState
  440. {
  441. #pragma warning disable CS0649
  442. public Boolean32 Enable;
  443. public LogicalOp LogicalOp;
  444. #pragma warning restore CS0649
  445. }
  446. /// <summary>
  447. /// Render target color buffer mask.
  448. /// This defines which color channels are written to the color buffer.
  449. /// </summary>
  450. struct RtColorMask
  451. {
  452. #pragma warning disable CS0649
  453. public uint Packed;
  454. #pragma warning restore CS0649
  455. /// <summary>
  456. /// Unpacks red channel enable.
  457. /// </summary>
  458. /// <returns>True to write the new red channel color, false to keep the old value</returns>
  459. public bool UnpackRed()
  460. {
  461. return (Packed & 0x1) != 0;
  462. }
  463. /// <summary>
  464. /// Unpacks green channel enable.
  465. /// </summary>
  466. /// <returns>True to write the new green channel color, false to keep the old value</returns>
  467. public bool UnpackGreen()
  468. {
  469. return (Packed & 0x10) != 0;
  470. }
  471. /// <summary>
  472. /// Unpacks blue channel enable.
  473. /// </summary>
  474. /// <returns>True to write the new blue channel color, false to keep the old value</returns>
  475. public bool UnpackBlue()
  476. {
  477. return (Packed & 0x100) != 0;
  478. }
  479. /// <summary>
  480. /// Unpacks alpha channel enable.
  481. /// </summary>
  482. /// <returns>True to write the new alpha channel color, false to keep the old value</returns>
  483. public bool UnpackAlpha()
  484. {
  485. return (Packed & 0x1000) != 0;
  486. }
  487. }
  488. /// <summary>
  489. /// Vertex buffer state.
  490. /// </summary>
  491. struct VertexBufferState
  492. {
  493. #pragma warning disable CS0649
  494. public uint Control;
  495. public GpuVa Address;
  496. public int Divisor;
  497. #pragma warning restore CS0649
  498. /// <summary>
  499. /// Vertex buffer stride, defined as the number of bytes occupied by each vertex in memory.
  500. /// </summary>
  501. /// <returns>Vertex buffer stride</returns>
  502. public int UnpackStride()
  503. {
  504. return (int)(Control & 0xfff);
  505. }
  506. /// <summary>
  507. /// Vertex buffer enable.
  508. /// </summary>
  509. /// <returns>True if the vertex buffer is enabled, false otherwise</returns>
  510. public bool UnpackEnable()
  511. {
  512. return (Control & (1 << 12)) != 0;
  513. }
  514. }
  515. /// <summary>
  516. /// Color buffer blending parameters, shared by all color buffers.
  517. /// </summary>
  518. struct BlendStateCommon
  519. {
  520. #pragma warning disable CS0649
  521. public Boolean32 SeparateAlpha;
  522. public BlendOp ColorOp;
  523. public BlendFactor ColorSrcFactor;
  524. public BlendFactor ColorDstFactor;
  525. public BlendOp AlphaOp;
  526. public BlendFactor AlphaSrcFactor;
  527. public uint Unknown0x1354;
  528. public BlendFactor AlphaDstFactor;
  529. #pragma warning restore CS0649
  530. }
  531. /// <summary>
  532. /// Color buffer blending parameters.
  533. /// </summary>
  534. struct BlendState
  535. {
  536. #pragma warning disable CS0649
  537. public Boolean32 SeparateAlpha;
  538. public BlendOp ColorOp;
  539. public BlendFactor ColorSrcFactor;
  540. public BlendFactor ColorDstFactor;
  541. public BlendOp AlphaOp;
  542. public BlendFactor AlphaSrcFactor;
  543. public BlendFactor AlphaDstFactor;
  544. public uint Padding;
  545. #pragma warning restore CS0649
  546. }
  547. /// <summary>
  548. /// Graphics shader stage state.
  549. /// </summary>
  550. struct ShaderState
  551. {
  552. #pragma warning disable CS0649
  553. public uint Control;
  554. public uint Offset;
  555. public uint Unknown0x8;
  556. public int MaxRegisters;
  557. public ShaderType Type;
  558. public uint Unknown0x14;
  559. public uint Unknown0x18;
  560. public uint Unknown0x1c;
  561. public uint Unknown0x20;
  562. public uint Unknown0x24;
  563. public uint Unknown0x28;
  564. public uint Unknown0x2c;
  565. public uint Unknown0x30;
  566. public uint Unknown0x34;
  567. public uint Unknown0x38;
  568. public uint Unknown0x3c;
  569. #pragma warning restore CS0649
  570. /// <summary>
  571. /// Unpacks shader enable information.
  572. /// Must be ignored for vertex shaders, those are always enabled.
  573. /// </summary>
  574. /// <returns>True if the stage is enabled, false otherwise</returns>
  575. public bool UnpackEnable()
  576. {
  577. return (Control & 1) != 0;
  578. }
  579. }
  580. /// <summary>
  581. /// Uniform buffer state for the uniform buffer currently being modified.
  582. /// </summary>
  583. struct UniformBufferState
  584. {
  585. #pragma warning disable CS0649
  586. public int Size;
  587. public GpuVa Address;
  588. public int Offset;
  589. #pragma warning restore CS0649
  590. }
  591. unsafe struct ThreedClassState : IShadowState
  592. {
  593. #pragma warning disable CS0649
  594. public uint SetObject;
  595. public int SetObjectClassId => (int)((SetObject >> 0) & 0xFFFF);
  596. public int SetObjectEngineId => (int)((SetObject >> 16) & 0x1F);
  597. public fixed uint Reserved04[63];
  598. public uint NoOperation;
  599. public uint SetNotifyA;
  600. public int SetNotifyAAddressUpper => (int)((SetNotifyA >> 0) & 0xFF);
  601. public uint SetNotifyB;
  602. public uint Notify;
  603. public NotifyType NotifyType => (NotifyType)(Notify);
  604. public uint WaitForIdle;
  605. public uint LoadMmeInstructionRamPointer;
  606. public uint LoadMmeInstructionRam;
  607. public uint LoadMmeStartAddressRamPointer;
  608. public uint LoadMmeStartAddressRam;
  609. public uint SetMmeShadowRamControl;
  610. public SetMmeShadowRamControlMode SetMmeShadowRamControlMode => (SetMmeShadowRamControlMode)((SetMmeShadowRamControl >> 0) & 0x3);
  611. public fixed uint Reserved128[2];
  612. public uint SetGlobalRenderEnableA;
  613. public int SetGlobalRenderEnableAOffsetUpper => (int)((SetGlobalRenderEnableA >> 0) & 0xFF);
  614. public uint SetGlobalRenderEnableB;
  615. public uint SetGlobalRenderEnableC;
  616. public int SetGlobalRenderEnableCMode => (int)((SetGlobalRenderEnableC >> 0) & 0x7);
  617. public uint SendGoIdle;
  618. public uint PmTrigger;
  619. public uint PmTriggerWfi;
  620. public fixed uint Reserved148[2];
  621. public uint SetInstrumentationMethodHeader;
  622. public uint SetInstrumentationMethodData;
  623. public fixed uint Reserved158[10];
  624. public uint LineLengthIn;
  625. public uint LineCount;
  626. public uint OffsetOutUpper;
  627. public int OffsetOutUpperValue => (int)((OffsetOutUpper >> 0) & 0xFF);
  628. public uint OffsetOut;
  629. public uint PitchOut;
  630. public uint SetDstBlockSize;
  631. public SetDstBlockSizeWidth SetDstBlockSizeWidth => (SetDstBlockSizeWidth)((SetDstBlockSize >> 0) & 0xF);
  632. public SetDstBlockSizeHeight SetDstBlockSizeHeight => (SetDstBlockSizeHeight)((SetDstBlockSize >> 4) & 0xF);
  633. public SetDstBlockSizeDepth SetDstBlockSizeDepth => (SetDstBlockSizeDepth)((SetDstBlockSize >> 8) & 0xF);
  634. public uint SetDstWidth;
  635. public uint SetDstHeight;
  636. public uint SetDstDepth;
  637. public uint SetDstLayer;
  638. public uint SetDstOriginBytesX;
  639. public int SetDstOriginBytesXV => (int)((SetDstOriginBytesX >> 0) & 0xFFFFF);
  640. public uint SetDstOriginSamplesY;
  641. public int SetDstOriginSamplesYV => (int)((SetDstOriginSamplesY >> 0) & 0xFFFF);
  642. public uint LaunchDma;
  643. public LaunchDmaDstMemoryLayout LaunchDmaDstMemoryLayout => (LaunchDmaDstMemoryLayout)((LaunchDma >> 0) & 0x1);
  644. public LaunchDmaCompletionType LaunchDmaCompletionType => (LaunchDmaCompletionType)((LaunchDma >> 4) & 0x3);
  645. public LaunchDmaInterruptType LaunchDmaInterruptType => (LaunchDmaInterruptType)((LaunchDma >> 8) & 0x3);
  646. public LaunchDmaSemaphoreStructSize LaunchDmaSemaphoreStructSize => (LaunchDmaSemaphoreStructSize)((LaunchDma >> 12) & 0x1);
  647. public bool LaunchDmaReductionEnable => (LaunchDma & 0x2) != 0;
  648. public LaunchDmaReductionOp LaunchDmaReductionOp => (LaunchDmaReductionOp)((LaunchDma >> 13) & 0x7);
  649. public LaunchDmaReductionFormat LaunchDmaReductionFormat => (LaunchDmaReductionFormat)((LaunchDma >> 2) & 0x3);
  650. public bool LaunchDmaSysmembarDisable => (LaunchDma & 0x40) != 0;
  651. public uint LoadInlineData;
  652. public fixed uint Reserved1B8[22];
  653. public Boolean32 EarlyZForce;
  654. public fixed uint Reserved214[45];
  655. public uint SyncpointAction;
  656. public fixed uint Reserved2CC[21];
  657. public TessMode TessMode;
  658. public Array4<float> TessOuterLevel;
  659. public Array2<float> TessInnerLevel;
  660. public fixed uint Reserved33C[16];
  661. public Boolean32 RasterizeEnable;
  662. public Array4<TfBufferState> TfBufferState;
  663. public fixed uint Reserved400[192];
  664. public Array4<TfState> TfState;
  665. public fixed uint Reserved740[1];
  666. public Boolean32 TfEnable;
  667. public fixed uint Reserved748[46];
  668. public Array8<RtColorState> RtColorState;
  669. public Array16<ViewportTransform> ViewportTransform;
  670. public Array16<ViewportExtents> ViewportExtents;
  671. public fixed uint ReservedD00[29];
  672. public VertexBufferDrawState VertexBufferDrawState;
  673. public uint DepthMode;
  674. public ClearColors ClearColors;
  675. public float ClearDepthValue;
  676. public fixed uint ReservedD94[3];
  677. public uint ClearStencilValue;
  678. public fixed uint ReservedDA4[2];
  679. public PolygonMode PolygonModeFront;
  680. public PolygonMode PolygonModeBack;
  681. public Boolean32 PolygonSmoothEnable;
  682. public fixed uint ReservedDB8[2];
  683. public DepthBiasState DepthBiasState;
  684. public int PatchVertices;
  685. public fixed uint ReservedDD0[4];
  686. public uint TextureBarrier;
  687. public uint WatchdogTimer;
  688. public Boolean32 PrimitiveRestartDrawArrays;
  689. public fixed uint ReservedDEC[5];
  690. public Array16<ScissorState> ScissorState;
  691. public fixed uint ReservedF00[21];
  692. public StencilBackMasks StencilBackMasks;
  693. public fixed uint ReservedF60[5];
  694. public uint InvalidateTextures;
  695. public fixed uint ReservedF78[1];
  696. public uint TextureBarrierTiled;
  697. public fixed uint ReservedF80[4];
  698. public Boolean32 RtColorMaskShared;
  699. public fixed uint ReservedF94[19];
  700. public RtDepthStencilState RtDepthStencilState;
  701. public ScreenScissorState ScreenScissorState;
  702. public fixed uint ReservedFFC[33];
  703. public int DrawTextureDstX;
  704. public int DrawTextureDstY;
  705. public int DrawTextureDstWidth;
  706. public int DrawTextureDstHeight;
  707. public long DrawTextureDuDx;
  708. public long DrawTextureDvDy;
  709. public int DrawTextureSamplerId;
  710. public int DrawTextureTextureId;
  711. public int DrawTextureSrcX;
  712. public int DrawTextureSrcY;
  713. public fixed uint Reserved10B0[18];
  714. public uint ClearFlags;
  715. public fixed uint Reserved10FC[25];
  716. public Array32<VertexAttribState> VertexAttribState;
  717. public fixed uint Reserved11E0[15];
  718. public RtControl RtControl;
  719. public fixed uint Reserved1220[2];
  720. public Size3D RtDepthStencilSize;
  721. public SamplerIndex SamplerIndex;
  722. public fixed uint Reserved1238[37];
  723. public Boolean32 DepthTestEnable;
  724. public fixed uint Reserved12D0[4];
  725. public Boolean32 AlphaToCoverageDitherEnable;
  726. public Boolean32 BlendIndependent;
  727. public Boolean32 DepthWriteEnable;
  728. public Boolean32 AlphaTestEnable;
  729. public fixed uint Reserved12F0[5];
  730. public uint VbElementU8;
  731. public uint Reserved1308;
  732. public CompareOp DepthTestFunc;
  733. public float AlphaTestRef;
  734. public CompareOp AlphaTestFunc;
  735. public uint Reserved1318;
  736. public ColorF BlendConstant;
  737. public fixed uint Reserved132C[4];
  738. public BlendStateCommon BlendStateCommon;
  739. public Boolean32 BlendEnableCommon;
  740. public Array8<Boolean32> BlendEnable;
  741. public StencilTestState StencilTestState;
  742. public fixed uint Reserved13A0[3];
  743. public YControl YControl;
  744. public float LineWidthSmooth;
  745. public float LineWidthAliased;
  746. public fixed uint Reserved13B8[27];
  747. public uint InvalidateSamplerCacheNoWfi;
  748. public uint InvalidateTextureHeaderCacheNoWfi;
  749. public fixed uint Reserved142C[2];
  750. public uint FirstVertex;
  751. public uint FirstInstance;
  752. public fixed uint Reserved143C[53];
  753. public uint ClipDistanceEnable;
  754. public uint Reserved1514;
  755. public float PointSize;
  756. public uint Reserved151C;
  757. public Boolean32 PointSpriteEnable;
  758. public fixed uint Reserved1524[3];
  759. public uint ResetCounter;
  760. public Boolean32 MultisampleEnable;
  761. public Boolean32 RtDepthStencilEnable;
  762. public uint MultisampleControl;
  763. public fixed uint Reserved1540[4];
  764. public GpuVa RenderEnableAddress;
  765. public Condition RenderEnableCondition;
  766. public PoolState SamplerPoolState;
  767. public uint Reserved1568;
  768. public float DepthBiasFactor;
  769. public Boolean32 LineSmoothEnable;
  770. public PoolState TexturePoolState;
  771. public fixed uint Reserved1580[5];
  772. public StencilBackTestState StencilBackTestState;
  773. public fixed uint Reserved15A8[5];
  774. public float DepthBiasUnits;
  775. public fixed uint Reserved15C0[4];
  776. public TextureMsaaMode RtMsaaMode;
  777. public fixed uint Reserved15D4[5];
  778. public uint VbElementU32;
  779. public uint Reserved15EC;
  780. public uint VbElementU16;
  781. public fixed uint Reserved15F4[4];
  782. public uint PointCoordReplace;
  783. public GpuVa ShaderBaseAddress;
  784. public uint Reserved1610;
  785. public uint DrawEnd;
  786. public uint DrawBegin;
  787. public fixed uint Reserved161C[10];
  788. public PrimitiveRestartState PrimitiveRestartState;
  789. public fixed uint Reserved164C[95];
  790. public IndexBufferState IndexBufferState;
  791. public uint IndexBufferCount;
  792. public uint DrawIndexedSmall;
  793. public uint DrawIndexedSmall2;
  794. public uint Reserved17EC;
  795. public uint DrawIndexedSmallIncInstance;
  796. public uint DrawIndexedSmallIncInstance2;
  797. public fixed uint Reserved17F8[33];
  798. public float DepthBiasClamp;
  799. public Array16<Boolean32> VertexBufferInstanced;
  800. public fixed uint Reserved18C0[20];
  801. public Boolean32 VertexProgramPointSize;
  802. public uint Reserved1914;
  803. public FaceState FaceState;
  804. public fixed uint Reserved1924[2];
  805. public uint ViewportTransformEnable;
  806. public fixed uint Reserved1930[3];
  807. public ViewVolumeClipControl ViewVolumeClipControl;
  808. public fixed uint Reserved1940[2];
  809. public Boolean32 PrimitiveTypeOverrideEnable;
  810. public fixed uint Reserved194C[9];
  811. public PrimitiveTypeOverride PrimitiveTypeOverride;
  812. public fixed uint Reserved1974[20];
  813. public LogicalOpState LogicOpState;
  814. public uint Reserved19CC;
  815. public uint Clear;
  816. public fixed uint Reserved19D4[11];
  817. public Array8<RtColorMask> RtColorMask;
  818. public fixed uint Reserved1A20[56];
  819. public GpuVa SemaphoreAddress;
  820. public int SemaphorePayload;
  821. public uint SemaphoreControl;
  822. public fixed uint Reserved1B10[60];
  823. public Array16<VertexBufferState> VertexBufferState;
  824. public fixed uint Reserved1D00[64];
  825. public Array8<BlendState> BlendState;
  826. public Array16<GpuVa> VertexBufferEndAddress;
  827. public fixed uint Reserved1F80[32];
  828. public Array6<ShaderState> ShaderState;
  829. public fixed uint Reserved2180[96];
  830. public uint SetFalcon00;
  831. public uint SetFalcon01;
  832. public uint SetFalcon02;
  833. public uint SetFalcon03;
  834. public uint SetFalcon04;
  835. public uint SetFalcon05;
  836. public uint SetFalcon06;
  837. public uint SetFalcon07;
  838. public uint SetFalcon08;
  839. public uint SetFalcon09;
  840. public uint SetFalcon10;
  841. public uint SetFalcon11;
  842. public uint SetFalcon12;
  843. public uint SetFalcon13;
  844. public uint SetFalcon14;
  845. public uint SetFalcon15;
  846. public uint SetFalcon16;
  847. public uint SetFalcon17;
  848. public uint SetFalcon18;
  849. public uint SetFalcon19;
  850. public uint SetFalcon20;
  851. public uint SetFalcon21;
  852. public uint SetFalcon22;
  853. public uint SetFalcon23;
  854. public uint SetFalcon24;
  855. public uint SetFalcon25;
  856. public uint SetFalcon26;
  857. public uint SetFalcon27;
  858. public uint SetFalcon28;
  859. public uint SetFalcon29;
  860. public uint SetFalcon30;
  861. public uint SetFalcon31;
  862. public UniformBufferState UniformBufferState;
  863. public Array16<uint> UniformBufferUpdateData;
  864. public fixed uint Reserved23D0[16];
  865. public uint UniformBufferBindVertex;
  866. public fixed uint Reserved2414[7];
  867. public uint UniformBufferBindTessControl;
  868. public fixed uint Reserved2434[7];
  869. public uint UniformBufferBindTessEvaluation;
  870. public fixed uint Reserved2454[7];
  871. public uint UniformBufferBindGeometry;
  872. public fixed uint Reserved2474[7];
  873. public uint UniformBufferBindFragment;
  874. public fixed uint Reserved2494[93];
  875. public uint TextureBufferIndex;
  876. public fixed uint Reserved260C[125];
  877. public Array4<Array32<uint>> TfVaryingLocations;
  878. public fixed uint Reserved2A00[640];
  879. public MmeShadowScratch SetMmeShadowScratch;
  880. #pragma warning restore CS0649
  881. }
  882. }