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/TextureMsaaMode.cs | 63 +++++++++++++++++---------- 1 file changed, 39 insertions(+), 24 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TextureMsaaMode.cs') 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 { + /// + /// Multisampled texture samples count. + /// enum TextureMsaaMode { Ms1x1 = 0, @@ -11,43 +14,55 @@ namespace Ryujinx.Graphics.Gpu.Image static class TextureMsaaModeConverter { + /// + /// Returns the total number of samples from the MSAA mode. + /// + /// The MSAA mode + /// The total number of samples 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 + }; } + /// + /// Returns the number of samples in the X direction from the MSAA mode. + /// + /// The MSAA mode + /// The number of samples in the X direction 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 + }; } + /// + /// Returns the number of samples in the Y direction from the MSAA mode. + /// + /// The MSAA mode + /// The number of samples in the Y direction 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 -- cgit v1.2.3