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

View file

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