diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2019-12-29 20:26:37 -0300 |
|---|---|---|
| committer | Thog <thog@protonmail.com> | 2020-01-09 02:13:00 +0100 |
| commit | 32764f95602611e9daa50362330d760e8ed83fda (patch) | |
| tree | f15d3c93714e45c88bce8bc177c3448ebaf518f8 /Ryujinx.Graphics.Gpu/Image/FormatInfo.cs | |
| parent | 53bbc1311f9819ac70fd51ae016e8c2070268086 (diff) | |
Add XML documentation to Ryujinx.Graphics.Gpu.Image
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/FormatInfo.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/FormatInfo.cs | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/FormatInfo.cs b/Ryujinx.Graphics.Gpu/Image/FormatInfo.cs index a728c66e..4f73bfa8 100644 --- a/Ryujinx.Graphics.Gpu/Image/FormatInfo.cs +++ b/Ryujinx.Graphics.Gpu/Image/FormatInfo.cs @@ -2,20 +2,48 @@ using Ryujinx.Graphics.GAL; namespace Ryujinx.Graphics.Gpu.Image { + /// <summary> + /// Represents texture format information. + /// </summary> struct FormatInfo { - private static FormatInfo _rgba8 = new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4); - - public static FormatInfo Default => _rgba8; + /// <summary> + /// A default, generic RGBA8 texture format. + /// </summary> + public static FormatInfo Default { get; } = new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4); + /// <summary> + /// The format of the texture data. + /// </summary> public Format Format { get; } - public int BlockWidth { get; } - public int BlockHeight { get; } + /// <summary> + /// The block width for compressed formats. Must be 1 for non-compressed formats. + /// </summary> + public int BlockWidth { get; } + + /// <summary> + /// The block height for compressed formats. Must be 1 for non-compressed formats. + /// </summary> + public int BlockHeight { get; } + + /// <summary> + /// The number of bytes occupied by a single pixel in memory of the texture data. + /// </summary> public int BytesPerPixel { get; } + /// <summary> + /// Whenever or not the texture format is a compressed format. Determined from block size. + /// </summary> public bool IsCompressed => (BlockWidth | BlockHeight) != 1; + /// <summary> + /// Constructs the texture format info structure. + /// </summary> + /// <param name="format">The format of the texture data</param> + /// <param name="blockWidth">The block width for compressed formats. Must be 1 for non-compressed formats</param> + /// <param name="blockHeight">The block height for compressed formats. Must be 1 for non-compressed formats</param> + /// <param name="bytesPerPixel">The number of bytes occupied by a single pixel in memory of the texture data</param> public FormatInfo( Format format, int blockWidth, |
