ThreedClassState.cs 32 KB

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