From 32764f95602611e9daa50362330d760e8ed83fda Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 29 Dec 2019 20:26:37 -0300 Subject: Add XML documentation to Ryujinx.Graphics.Gpu.Image --- Ryujinx.Graphics.Gpu/Image/TextureInfo.cs | 128 +++++++++++++++++++++++++++--- 1 file changed, 117 insertions(+), 11 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TextureInfo.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/TextureInfo.cs b/Ryujinx.Graphics.Gpu/Image/TextureInfo.cs index 19110dcf..784ff0e9 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureInfo.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureInfo.cs @@ -2,35 +2,131 @@ using Ryujinx.Graphics.GAL; namespace Ryujinx.Graphics.Gpu.Image { + /// + /// Texture information. + /// struct TextureInfo { + /// + /// Address of the texture in guest memory. + /// public ulong Address { get; } - public int Width { get; } - public int Height { get; } - public int DepthOrLayers { get; } - public int Levels { get; } - public int SamplesInX { get; } - public int SamplesInY { get; } - public int Stride { get; } - public bool IsLinear { get; } - public int GobBlocksInY { get; } - public int GobBlocksInZ { get; } - public int GobBlocksInTileX { get; } + /// + /// The width of the texture. + /// + public int Width { get; } + /// + /// The height of the texture, or layers count for 1D array textures. + /// + public int Height { get; } + + /// + /// The depth of the texture (for 3D textures), or layers count for array textures. + /// + public int DepthOrLayers { get; } + + /// + /// The number of mipmap levels of the texture. + /// + public int Levels { get; } + + /// + /// The number of samples in the X direction for multisampled textures. + /// + public int SamplesInX { get; } + + /// + /// The number of samples in the Y direction for multisampled textures. + /// + public int SamplesInY { get; } + + /// + /// The number of bytes per line for linear textures. + /// + public int Stride { get; } + + /// + /// Indicates whenever or not the texture is a linear texture. + /// + public bool IsLinear { get; } + + /// + /// GOB blocks in the Y direction, for block linear textures. + /// + public int GobBlocksInY { get; } + + /// + /// GOB blocks in the Z direction, for block linear textures. + /// + public int GobBlocksInZ { get; } + + /// + /// Number of GOB blocks per tile in the X direction, for block linear textures. + /// + public int GobBlocksInTileX { get; } + + /// + /// Total number of samples for multisampled textures. + /// public int Samples => SamplesInX * SamplesInY; + /// + /// Texture target type. + /// public Target Target { get; } + /// + /// Texture format information. + /// public FormatInfo FormatInfo { get; } + /// + /// Depth-stencil mode of the texture. This defines whenever the depth or stencil value is read from shaders, + /// for depth-stencil texture formats. + /// public DepthStencilMode DepthStencilMode { get; } + /// + /// Texture swizzle for the red color channel. + /// public SwizzleComponent SwizzleR { get; } + /// + /// Texture swizzle for the green color channel. + /// public SwizzleComponent SwizzleG { get; } + /// + /// Texture swizzle for the blue color channel. + /// public SwizzleComponent SwizzleB { get; } + /// + /// Texture swizzle for the alpha color channel. + /// public SwizzleComponent SwizzleA { get; } + /// + /// Constructs the texture information structure. + /// + /// The address of the texture + /// The width of the texture + /// The height or the texture + /// The depth or layers count of the texture + /// The amount if mipmap levels of the texture + /// The number of samples in the X direction for multisample textures, should be 1 otherwise + /// The number of samples in the Y direction for multisample textures, should be 1 otherwise + /// The stride for linear textures + /// Whenever the texture is linear or block linear + /// Number of GOB blocks in the Y direction + /// Number of GOB blocks in the Z direction + /// Number of GOB blocks per tile in the X direction + /// Texture target type + /// Texture format information + /// Depth-stencil mode + /// Swizzle for the red color channel + /// Swizzle for the green color channel + /// Swizzle for the blue color channel + /// Swizzle for the alpha color channel public TextureInfo( ulong address, int width, @@ -73,11 +169,21 @@ namespace Ryujinx.Graphics.Gpu.Image SwizzleA = swizzleA; } + /// + /// Gets the real texture depth. + /// Returns 1 for any target other than 3D textures. + /// + /// Texture depth public int GetDepth() { return Target == Target.Texture3D ? DepthOrLayers : 1; } + /// + /// Gets the number of layers of the texture. + /// Returns 1 for non-array textures, 6 for cubemap textures, and layer faces for cubemap array textures. + /// + /// The number of texture layers public int GetLayers() { if (Target == Target.Texture2DArray || Target == Target.Texture2DMultisampleArray) -- cgit v1.2.3