aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2019-12-29 20:26:37 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit32764f95602611e9daa50362330d760e8ed83fda (patch)
treef15d3c93714e45c88bce8bc177c3448ebaf518f8 /Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs
parent53bbc1311f9819ac70fd51ae016e8c2070268086 (diff)
Add XML documentation to Ryujinx.Graphics.Gpu.Image
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs63
1 files changed, 39 insertions, 24 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs b/Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs
index 13421067..0461888f 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs
@@ -1,5 +1,8 @@
namespace Ryujinx.Graphics.Gpu.Image
{
+ /// <summary>
+ /// Multisampled texture samples count.
+ /// </summary>
enum TextureMsaaMode
{
Ms1x1 = 0,
@@ -11,43 +14,55 @@ namespace Ryujinx.Graphics.Gpu.Image
static class TextureMsaaModeConverter
{
+ /// <summary>
+ /// Returns the total number of samples from the MSAA mode.
+ /// </summary>
+ /// <param name="msaaMode">The MSAA mode</param>
+ /// <returns>The total number of samples</returns>
public static int SamplesCount(this TextureMsaaMode msaaMode)
{
- switch (msaaMode)
+ return msaaMode switch
{
- case TextureMsaaMode.Ms2x1: return 2;
- case TextureMsaaMode.Ms2x2: return 4;
- case TextureMsaaMode.Ms4x2: return 8;
- case TextureMsaaMode.Ms4x4: return 16;
- }
-
- return 1;
+ TextureMsaaMode.Ms2x1 => 2,
+ TextureMsaaMode.Ms2x2 => 4,
+ TextureMsaaMode.Ms4x2 => 8,
+ TextureMsaaMode.Ms4x4 => 16,
+ _ => 1
+ };
}
+ /// <summary>
+ /// Returns the number of samples in the X direction from the MSAA mode.
+ /// </summary>
+ /// <param name="msaaMode">The MSAA mode</param>
+ /// <returns>The number of samples in the X direction</returns>
public static int SamplesInX(this TextureMsaaMode msaaMode)
{
- switch (msaaMode)
+ return msaaMode switch
{
- case TextureMsaaMode.Ms2x1: return 2;
- case TextureMsaaMode.Ms2x2: return 2;
- case TextureMsaaMode.Ms4x2: return 4;
- case TextureMsaaMode.Ms4x4: return 4;
- }
-
- return 1;
+ TextureMsaaMode.Ms2x1 => 2,
+ TextureMsaaMode.Ms2x2 => 2,
+ TextureMsaaMode.Ms4x2 => 4,
+ TextureMsaaMode.Ms4x4 => 4,
+ _ => 1
+ };
}
+ /// <summary>
+ /// Returns the number of samples in the Y direction from the MSAA mode.
+ /// </summary>
+ /// <param name="msaaMode">The MSAA mode</param>
+ /// <returns>The number of samples in the Y direction</returns>
public static int SamplesInY(this TextureMsaaMode msaaMode)
{
- switch (msaaMode)
+ return msaaMode switch
{
- case TextureMsaaMode.Ms2x1: return 1;
- case TextureMsaaMode.Ms2x2: return 2;
- case TextureMsaaMode.Ms4x2: return 2;
- case TextureMsaaMode.Ms4x4: return 4;
- }
-
- return 1;
+ TextureMsaaMode.Ms2x1 => 1,
+ TextureMsaaMode.Ms2x2 => 2,
+ TextureMsaaMode.Ms4x2 => 2,
+ TextureMsaaMode.Ms4x4 => 4,
+ _ => 1
+ };
}
}
} \ No newline at end of file