Constants.cs
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 17 /// <summary> 18 /// Maximum number of compute storage buffers. 19 /// </summary> 20 /// <remarks> 21 /// The maximum number of storage buffers is API limited, the hardware supports an unlimited amount. 22 /// </remarks> 23 public const int TotalCpStorageBuffers = 16; 24 25 /// <summary> 26 /// Maximum number of graphics uniform buffers. 27 /// </summary> 28 public const int TotalGpUniformBuffers = 18; 29 30 /// <summary> 31 /// Maximum number of graphics storage buffers. 32 /// </summary> 33 /// <remarks> 34 /// The maximum number of storage buffers is API limited, the hardware supports an unlimited amount. 35 /// </remarks> 36 public const int TotalGpStorageBuffers = 16; 37 38 /// <summary> 39 /// Maximum number of transform feedback buffers. 40 /// </summary> 41 public const int TotalTransformFeedbackBuffers = 4; 42 43 /// <summary> 44 /// Maximum number of render target color buffers. 45 /// </summary> 46 public const int TotalRenderTargets = 8; 47 48 /// <summary> 49 /// Number of shader stages. 50 /// </summary> 51 public const int ShaderStages = 5; 52 53 /// <summary> 54 /// Maximum number of vertex attributes. 55 /// </summary> 56 public const int TotalVertexAttribs = 16; // FIXME: Should be 32, but OpenGL only supports 16. 57 58 /// <summary> 59 /// Maximum number of vertex buffers. 60 /// </summary> 61 public const int TotalVertexBuffers = 16; 62 63 /// <summary> 64 /// Maximum number of viewports. 65 /// </summary> 66 public const int TotalViewports = 16; 67 68 /// <summary> 69 /// Maximum size of gl_ClipDistance array in shaders. 70 /// </summary> 71 public const int TotalClipDistances = 8; 72 73 /// <summary> 74 /// Byte alignment for texture stride. 75 /// </summary> 76 public const int StrideAlignment = 32; 77 78 /// <summary> 79 /// Byte alignment for block linear textures 80 /// </summary> 81 public const int GobAlignment = 64; 82 83 /// <summary> 84 /// Number of the uniform buffer reserved by the driver to store the storage buffer base addresses. 85 /// </summary> 86 public const int DriverReservedUniformBuffer = 0; 87 88 /// <summary> 89 /// Maximum size that an storage buffer is assumed to have when the correct size is unknown. 90 /// </summary> 91 public const ulong MaxUnknownStorageSize = 0x100000; 92 93 /// <summary> 94 /// Size of a bindless texture handle as exposed by guest graphics APIs. 95 /// </summary> 96 public const int TextureHandleSizeInBytes = sizeof(ulong); 97 } 98 }