Replace out param with tuple return value

This commit is contained in:
gdk 2022-03-29 19:00:44 -03:00
parent ef6a099392
commit e15247fbc4
2 changed files with 5 additions and 7 deletions

View file

@ -70,7 +70,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
AppendLine("}" + suffix);
}
public TextureDescriptor FindTextureDescriptor(AstTextureOperation texOp, out int descriptorIndex)
public (TextureDescriptor, int) FindTextureDescriptor(AstTextureOperation texOp)
{
TextureDescriptor[] descriptors = Config.GetTextureDescriptors();
@ -82,13 +82,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
descriptor.HandleIndex == texOp.Handle &&
descriptor.Format == texOp.Format)
{
descriptorIndex = i;
return descriptor;
return (descriptor, i);
}
}
descriptorIndex = -1;
return default;
return (default, -1);
}
private static int FindDescriptorIndex(TextureDescriptor[] array, AstTextureOperation texOp)

View file

@ -762,8 +762,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
}
else
{
SamplerType declarationType = context.FindTextureDescriptor(texOp, out int descriptorIndex).Type;
bool hasLod = !declarationType.HasFlag(SamplerType.Multisample) && declarationType != SamplerType.TextureBuffer;
(TextureDescriptor descriptor, int descriptorIndex) = context.FindTextureDescriptor(texOp);
bool hasLod = !descriptor.Type.HasFlag(SamplerType.Multisample) && descriptor.Type != SamplerType.TextureBuffer;
string texCall;
if (hasLod)