misc: chore: Merge duplicated 'if' branches

This commit is contained in:
KeatonTheBot
2025-09-25 17:04:06 -05:00
parent dfb6164ba5
commit d773bd60f4
22 changed files with 76 additions and 306 deletions
@@ -852,11 +852,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
bool hasDepth = dsFormat.Format.HasDepth();
bool hasStencil = dsFormat.Format.HasStencil();
if (hasStencil && (!clearStencil || (clearAffectedByStencilMask && _state.State.StencilTestState.FrontMask != 0xff)))
{
fullClear = false;
}
else if (hasDepth && !clearDepth)
if (hasStencil && (!clearStencil || (clearAffectedByStencilMask && _state.State.StencilTestState.FrontMask != 0xff)) ||
hasDepth && !clearDepth)
{
fullClear = false;
}
+5 -17
View File
@@ -1187,12 +1187,8 @@ namespace Ryujinx.Graphics.Gpu.Image
return matchQuality;
}
if (!TextureCompatibility.LayoutMatches(Info, info))
{
return TextureMatchQuality.NoMatch;
}
if (!TextureCompatibility.SizeMatches(Info, info, forSampler))
if (!TextureCompatibility.LayoutMatches(Info, info)
|| !TextureCompatibility.SizeMatches(Info, info, forSampler))
{
return TextureMatchQuality.NoMatch;
}
@@ -1277,17 +1273,9 @@ namespace Ryujinx.Graphics.Gpu.Image
int offset = Range.FindOffset(range);
if (offset < 0 || !_sizeInfo.FindView(offset, out firstLayer, out firstLevel))
{
return TextureViewCompatibility.LayoutIncompatible;
}
if (!TextureCompatibility.ViewLayoutCompatible(Info, info, firstLevel))
{
return TextureViewCompatibility.LayoutIncompatible;
}
if (info.GetSlices() > 1 && LayerSize != layerSize)
if (offset < 0 || !_sizeInfo.FindView(offset, out firstLayer, out firstLevel) ||
!TextureCompatibility.ViewLayoutCompatible(Info, info, firstLevel) ||
info.GetSlices() > 1 && LayerSize != layerSize)
{
return TextureViewCompatibility.LayoutIncompatible;
}
@@ -243,11 +243,8 @@ namespace Ryujinx.Graphics.Gpu.Image
}
else if ((lhs.FormatInfo.Format == Format.D24UnormS8Uint ||
lhs.FormatInfo.Format == Format.S8UintD24Unorm ||
lhs.FormatInfo.Format == Format.X8UintD24Unorm) && rhs.FormatInfo.Format == Format.B8G8R8A8Unorm)
{
return TextureMatchQuality.FormatAlias;
}
else if (lhs.FormatInfo.Format == Format.D32FloatS8Uint && rhs.FormatInfo.Format == Format.R32G32Float)
lhs.FormatInfo.Format == Format.X8UintD24Unorm) && rhs.FormatInfo.Format == Format.B8G8R8A8Unorm ||
lhs.FormatInfo.Format == Format.D32FloatS8Uint && rhs.FormatInfo.Format == Format.R32G32Float)
{
return TextureMatchQuality.FormatAlias;
}