GpuChannelGraphicsState.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Ryujinx.Graphics.GAL;
  2. using Ryujinx.Graphics.Gpu.Engine.Threed;
  3. namespace Ryujinx.Graphics.Gpu.Shader
  4. {
  5. /// <summary>
  6. /// State used by the <see cref="GpuAccessor"/>.
  7. /// </summary>
  8. struct GpuChannelGraphicsState
  9. {
  10. // New fields should be added to the end of the struct to keep disk shader cache compatibility.
  11. /// <summary>
  12. /// Early Z force enable.
  13. /// </summary>
  14. public readonly bool EarlyZForce;
  15. /// <summary>
  16. /// Primitive topology of current draw.
  17. /// </summary>
  18. public readonly PrimitiveTopology Topology;
  19. /// <summary>
  20. /// Tessellation mode.
  21. /// </summary>
  22. public readonly TessMode TessellationMode;
  23. /// <summary>
  24. /// Indicates whenever the viewport transform is disabled.
  25. /// </summary>
  26. public readonly bool ViewportTransformDisable;
  27. /// <summary>
  28. /// Indicates whenever alpha-to-coverage is enabled.
  29. /// </summary>
  30. public readonly bool AlphaToCoverageEnable;
  31. /// <summary>
  32. /// Indicates whenever alpha-to-coverage dithering is enabled.
  33. /// </summary>
  34. public readonly bool AlphaToCoverageDitherEnable;
  35. /// <summary>
  36. /// Creates a new GPU graphics state.
  37. /// </summary>
  38. /// <param name="earlyZForce">Early Z force enable</param>
  39. /// <param name="topology">Primitive topology</param>
  40. /// <param name="tessellationMode">Tessellation mode</param>
  41. /// <param name="viewportTransformDisable">Indicates whenever the viewport transform is disabled</param>
  42. /// <param name="alphaToCoverageEnable">Indicates whenever alpha-to-coverage is enabled</param>
  43. /// <param name="alphaToCoverageDitherEnable">Indicates whenever alpha-to-coverage dithering is enabled</param>
  44. public GpuChannelGraphicsState(
  45. bool earlyZForce,
  46. PrimitiveTopology topology,
  47. TessMode tessellationMode,
  48. bool viewportTransformDisable,
  49. bool alphaToCoverageEnable,
  50. bool alphaToCoverageDitherEnable)
  51. {
  52. EarlyZForce = earlyZForce;
  53. Topology = topology;
  54. TessellationMode = tessellationMode;
  55. ViewportTransformDisable = viewportTransformDisable;
  56. AlphaToCoverageEnable = alphaToCoverageEnable;
  57. AlphaToCoverageDitherEnable = alphaToCoverageDitherEnable;
  58. }
  59. }
  60. }