misc: chore: Merge into pattern

This commit is contained in:
KeatonTheBot 2025-09-25 16:45:15 -05:00
parent a6f3f0718d
commit 48ba1cc9ed
161 changed files with 470 additions and 550 deletions

View file

@ -228,14 +228,12 @@ namespace Ryujinx.Graphics.OpenGL
public static bool IsPackedDepthStencil(Format format)
{
return format == Format.D24UnormS8Uint ||
format == Format.D32FloatS8Uint ||
format == Format.S8UintD24Unorm;
return format is Format.D24UnormS8Uint or Format.D32FloatS8Uint or Format.S8UintD24Unorm;
}
public static bool IsDepthOnly(Format format)
{
return format == Format.D16Unorm || format == Format.D32Float || format == Format.X8UintD24Unorm;
return format is Format.D16Unorm or Format.D32Float or Format.X8UintD24Unorm;
}
}
}

View file

@ -43,13 +43,13 @@ namespace Ryujinx.Graphics.OpenGL
private static readonly Lazy<GpuVendor> _gpuVendor = new(GetGpuVendor);
private static bool IsIntel => _gpuVendor.Value == GpuVendor.IntelWindows || _gpuVendor.Value == GpuVendor.IntelUnix;
private static bool IsIntel => _gpuVendor.Value is GpuVendor.IntelWindows or GpuVendor.IntelUnix;
public static GpuVendor Vendor => _gpuVendor.Value;
private static readonly Lazy<float> _maxSupportedAnisotropy = new(GL.GetFloat((GetPName)All.MaxTextureMaxAnisotropy));
public static bool UsePersistentBufferForFlush => _gpuVendor.Value == GpuVendor.AmdWindows || _gpuVendor.Value == GpuVendor.Nvidia;
public static bool UsePersistentBufferForFlush => _gpuVendor.Value is GpuVendor.AmdWindows or GpuVendor.Nvidia;
public static bool SupportsAlphaToCoverageDitherControl => _supportsAlphaToCoverageDitherControl.Value;
public static bool SupportsAstcCompression => _supportsAstcCompression.Value;
@ -117,11 +117,11 @@ namespace Ryujinx.Graphics.OpenGL
return renderer.Contains("mesa") ? GpuVendor.IntelUnix : GpuVendor.IntelWindows;
}
else if (vendor == "ati technologies inc." || vendor == "advanced micro devices, inc.")
else if (vendor is "ati technologies inc." or "advanced micro devices, inc.")
{
return GpuVendor.AmdWindows;
}
else if (vendor == "amd" || vendor == "x.org")
else if (vendor is "amd" or "x.org")
{
return GpuVendor.AmdUnix;
}

View file

@ -290,7 +290,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
private static FramebufferAttachment AttachmentForFormat(Format format)
{
if (format == Format.D24UnormS8Uint || format == Format.D32FloatS8Uint)
if (format is Format.D24UnormS8Uint or Format.D32FloatS8Uint)
{
return FramebufferAttachment.DepthStencilAttachment;
}

View file

@ -358,7 +358,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
PixelFormat pixelFormat = format.PixelFormat;
PixelType pixelType = format.PixelType;
if (target == TextureTarget.TextureCubeMap || target == TextureTarget.TextureCubeMapArray)
if (target is TextureTarget.TextureCubeMap or TextureTarget.TextureCubeMapArray)
{
target = TextureTarget.TextureCubeMapPositiveX + (layer % 6);
}

View file

@ -104,8 +104,7 @@ namespace Ryujinx.Graphics.OpenGL
int offset = attrib.Offset;
int size = fmtInfo.Components;
bool isFloat = fmtInfo.PixelType == PixelType.Float ||
fmtInfo.PixelType == PixelType.HalfFloat;
bool isFloat = fmtInfo.PixelType is PixelType.Float or PixelType.HalfFloat;
if (isFloat || fmtInfo.Normalized || fmtInfo.Scaled)
{