diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2024-05-23 01:05:32 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-23 01:05:32 -0300 |
| commit | e65effcb05c40247fb717b3c2409abce7ffa10fc (patch) | |
| tree | bd25b74ac762aebf1e30b12ed366bdc69e9f8e89 /src/Ryujinx.Graphics.GAL | |
| parent | c1ed1509493cdf69b39fddc1ae8b2f3d877adec6 (diff) | |
Workaround AMD bug on logic op with float framebuffer (#6852)
* Workaround AMD bug on logic op with float framebuffer
* Format whitespace
* Update comment
Diffstat (limited to 'src/Ryujinx.Graphics.GAL')
| -rw-r--r-- | src/Ryujinx.Graphics.GAL/Format.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.GAL/Format.cs b/src/Ryujinx.Graphics.GAL/Format.cs index bd3b38a9..17c42d2d 100644 --- a/src/Ryujinx.Graphics.GAL/Format.cs +++ b/src/Ryujinx.Graphics.GAL/Format.cs @@ -711,5 +711,36 @@ namespace Ryujinx.Graphics.GAL { return format.IsUint() || format.IsSint(); } + + /// <summary> + /// Checks if the texture format is a float or sRGB color format. + /// </summary> + /// <remarks> + /// Does not include normalized, compressed or depth formats. + /// Float and sRGB formats do not participate in logical operations. + /// </remarks> + /// <param name="format">Texture format</param> + /// <returns>True if the format is a float or sRGB color format, false otherwise</returns> + public static bool IsFloatOrSrgb(this Format format) + { + switch (format) + { + case Format.R8G8B8A8Srgb: + case Format.B8G8R8A8Srgb: + case Format.R16Float: + case Format.R16G16Float: + case Format.R16G16B16Float: + case Format.R16G16B16A16Float: + case Format.R32Float: + case Format.R32G32Float: + case Format.R32G32B32Float: + case Format.R32G32B32A32Float: + case Format.R11G11B10Float: + case Format.R9G9B9E5Float: + return true; + } + + return false; + } } } |
