Constants.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. namespace Ryujinx.Graphics.Gpu
  2. {
  3. /// <summary>
  4. /// Common Maxwell GPU constants.
  5. /// </summary>
  6. static class Constants
  7. {
  8. /// <summary>
  9. /// Maximum number of compute uniform buffers.
  10. /// </summary>
  11. /// <remarks>
  12. /// This does not reflect the hardware count, the API will emulate some constant buffers using
  13. /// global memory to make up for the low amount of compute constant buffers supported by hardware (only 8).
  14. /// </remarks>
  15. public const int TotalCpUniformBuffers = 17; // 8 hardware constant buffers + 9 emulated (14 available to the user).
  16. /// <summary>
  17. /// Maximum number of compute storage buffers.
  18. /// </summary>
  19. /// <remarks>
  20. /// The maximum number of storage buffers is API limited, the hardware supports an unlimited amount.
  21. /// </remarks>
  22. public const int TotalCpStorageBuffers = 16;
  23. /// <summary>
  24. /// Maximum number of graphics uniform buffers.
  25. /// </summary>
  26. public const int TotalGpUniformBuffers = 18;
  27. /// <summary>
  28. /// Maximum number of graphics storage buffers.
  29. /// </summary>
  30. /// <remarks>
  31. /// The maximum number of storage buffers is API limited, the hardware supports an unlimited amount.
  32. /// </remarks>
  33. public const int TotalGpStorageBuffers = 16;
  34. /// <summary>
  35. /// Maximum number of transform feedback buffers.
  36. /// </summary>
  37. public const int TotalTransformFeedbackBuffers = 4;
  38. /// <summary>
  39. /// Maximum number of textures on a single shader stage.
  40. /// </summary>
  41. /// <remarks>
  42. /// The maximum number of textures is API limited, the hardware supports an unlimited amount.
  43. /// </remarks>
  44. public const int TotalTextures = 32;
  45. /// <summary>
  46. /// Maximum number of images on a single shader stage.
  47. /// </summary>
  48. /// <remarks>
  49. /// The maximum number of images is API limited, the hardware supports an unlimited amount.
  50. /// </remarks>
  51. public const int TotalImages = 8;
  52. /// <summary>
  53. /// Maximum number of render target color buffers.
  54. /// </summary>
  55. public const int TotalRenderTargets = 8;
  56. /// <summary>
  57. /// Number of shader stages.
  58. /// </summary>
  59. public const int ShaderStages = 5;
  60. /// <summary>
  61. /// Maximum number of vertex attributes.
  62. /// </summary>
  63. public const int TotalVertexAttribs = 16; // FIXME: Should be 32, but OpenGL only supports 16.
  64. /// <summary>
  65. /// Maximum number of vertex buffers.
  66. /// </summary>
  67. public const int TotalVertexBuffers = 16;
  68. /// <summary>
  69. /// Maximum number of viewports.
  70. /// </summary>
  71. public const int TotalViewports = 16;
  72. /// <summary>
  73. /// Maximum size of gl_ClipDistance array in shaders.
  74. /// </summary>
  75. public const int TotalClipDistances = 8;
  76. /// <summary>
  77. /// Byte alignment for texture stride.
  78. /// </summary>
  79. public const int StrideAlignment = 32;
  80. /// <summary>
  81. /// Byte alignment for block linear textures
  82. /// </summary>
  83. public const int GobAlignment = 64;
  84. /// <summary>
  85. /// Expected byte alignment for storage buffers
  86. /// </summary>
  87. public const int StorageAlignment = 16;
  88. }
  89. }