aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Constants.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /src/Ryujinx.Graphics.Gpu/Constants.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Constants.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Constants.cs104
1 files changed, 104 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Constants.cs b/src/Ryujinx.Graphics.Gpu/Constants.cs
new file mode 100644
index 00000000..1897f5d0
--- /dev/null
+++ b/src/Ryujinx.Graphics.Gpu/Constants.cs
@@ -0,0 +1,104 @@
+namespace Ryujinx.Graphics.Gpu
+{
+ /// <summary>
+ /// Common Maxwell GPU constants.
+ /// </summary>
+ static class Constants
+ {
+ /// <summary>
+ /// Maximum number of compute uniform buffers.
+ /// </summary>
+ /// <remarks>
+ /// This does not reflect the hardware count, the API will emulate some constant buffers using
+ /// global memory to make up for the low amount of compute constant buffers supported by hardware (only 8).
+ /// </remarks>
+ public const int TotalCpUniformBuffers = 17; // 8 hardware constant buffers + 9 emulated (14 available to the user).
+
+ /// <summary>
+ /// Maximum number of compute storage buffers.
+ /// </summary>
+ /// <remarks>
+ /// The maximum number of storage buffers is API limited, the hardware supports an unlimited amount.
+ /// </remarks>
+ public const int TotalCpStorageBuffers = 16;
+
+ /// <summary>
+ /// Maximum number of graphics uniform buffers.
+ /// </summary>
+ public const int TotalGpUniformBuffers = 18;
+
+ /// <summary>
+ /// Maximum number of graphics storage buffers.
+ /// </summary>
+ /// <remarks>
+ /// The maximum number of storage buffers is API limited, the hardware supports an unlimited amount.
+ /// </remarks>
+ public const int TotalGpStorageBuffers = 16;
+
+ /// <summary>
+ /// Maximum number of transform feedback buffers.
+ /// </summary>
+ public const int TotalTransformFeedbackBuffers = 4;
+
+ /// <summary>
+ /// Maximum number of textures on a single shader stage.
+ /// </summary>
+ /// <remarks>
+ /// The maximum number of textures is API limited, the hardware supports an unlimited amount.
+ /// </remarks>
+ public const int TotalTextures = 32;
+
+ /// <summary>
+ /// Maximum number of images on a single shader stage.
+ /// </summary>
+ /// <remarks>
+ /// The maximum number of images is API limited, the hardware supports an unlimited amount.
+ /// </remarks>
+ public const int TotalImages = 8;
+
+ /// <summary>
+ /// Maximum number of render target color buffers.
+ /// </summary>
+ public const int TotalRenderTargets = 8;
+
+ /// <summary>
+ /// Number of shader stages.
+ /// </summary>
+ public const int ShaderStages = 5;
+
+ /// <summary>
+ /// Maximum number of vertex attributes.
+ /// </summary>
+ public const int TotalVertexAttribs = 16; // FIXME: Should be 32, but OpenGL only supports 16.
+
+ /// <summary>
+ /// Maximum number of vertex buffers.
+ /// </summary>
+ public const int TotalVertexBuffers = 16;
+
+ /// <summary>
+ /// Maximum number of viewports.
+ /// </summary>
+ public const int TotalViewports = 16;
+
+ /// <summary>
+ /// Maximum size of gl_ClipDistance array in shaders.
+ /// </summary>
+ public const int TotalClipDistances = 8;
+
+ /// <summary>
+ /// Byte alignment for texture stride.
+ /// </summary>
+ public const int StrideAlignment = 32;
+
+ /// <summary>
+ /// Byte alignment for block linear textures
+ /// </summary>
+ public const int GobAlignment = 64;
+
+ /// <summary>
+ /// Expected byte alignment for storage buffers
+ /// </summary>
+ public const int StorageAlignment = 16;
+ }
+} \ No newline at end of file