misc: chore: Remove redundant code

This commit is contained in:
KeatonTheBot
2025-03-11 16:45:41 -05:00
parent 340ec79e9f
commit 05a88ccc94
109 changed files with 271 additions and 412 deletions
@@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
{
using IrOperandType = IntermediateRepresentation.OperandType;
partial class CodeGenContext : Module
class CodeGenContext : Module
{
private const uint SpirvVersionMajor = 1;
private const uint SpirvVersionMinor = 3;
@@ -4,17 +4,10 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
{
class StructuredProgramInfo
{
public List<StructuredFunction> Functions { get; }
public List<StructuredFunction> Functions { get; } = [];
public HashSet<IoDefinition> IoDefinitions { get; }
public HashSet<IoDefinition> IoDefinitions { get; } = [];
public HelperFunctionsMask HelperFunctionsMask { get; set; }
public StructuredProgramInfo()
{
Functions = [];
IoDefinitions = [];
}
}
}
@@ -4,31 +4,22 @@ using System.Numerics;
namespace Ryujinx.Graphics.Shader.Translation
{
class AttributeUsage
class AttributeUsage(IGpuAccessor gpuAccessor)
{
public bool NextUsesFixedFuncAttributes { get; private set; }
public int UsedInputAttributes { get; private set; }
public int UsedOutputAttributes { get; private set; }
public HashSet<int> UsedInputAttributesPerPatch { get; }
public HashSet<int> UsedOutputAttributesPerPatch { get; }
public HashSet<int> UsedInputAttributesPerPatch { get; } = [];
public HashSet<int> UsedOutputAttributesPerPatch { get; } = [];
public HashSet<int> NextUsedInputAttributesPerPatch { get; private set; }
public int PassthroughAttributes { get; private set; }
private int _nextUsedInputAttributes;
private int _thisUsedInputAttributes;
private Dictionary<int, int> _perPatchAttributeLocations;
private readonly IGpuAccessor _gpuAccessor;
public UInt128 NextInputAttributesComponents { get; private set; }
public UInt128 ThisInputAttributesComponents { get; private set; }
public AttributeUsage(IGpuAccessor gpuAccessor)
{
_gpuAccessor = gpuAccessor;
UsedInputAttributesPerPatch = [];
UsedOutputAttributesPerPatch = [];
}
public void SetInputUserAttribute(int index, int component)
{
int mask = 1 << index;
@@ -74,7 +65,7 @@ namespace Ryujinx.Graphics.Shader.Translation
int location = BitOperations.TrailingZeroCount(freeMask);
if (location == 32)
{
_gpuAccessor.Log($"No enough free locations for patch input/output 0x{attr:X}.");
gpuAccessor.Log($"No enough free locations for patch input/output 0x{attr:X}.");
break;
}
@@ -61,18 +61,12 @@ namespace Ryujinx.Graphics.Shader.Translation
private readonly TransformFeedbackOutput[] _transformFeedbackOutputs;
readonly struct TransformFeedbackVariable : IEquatable<TransformFeedbackVariable>
readonly struct TransformFeedbackVariable(IoVariable ioVariable, int location = 0, int component = 0)
: IEquatable<TransformFeedbackVariable>
{
public IoVariable IoVariable { get; }
public int Location { get; }
public int Component { get; }
public TransformFeedbackVariable(IoVariable ioVariable, int location = 0, int component = 0)
{
IoVariable = ioVariable;
Location = location;
Component = component;
}
public IoVariable IoVariable { get; } = ioVariable;
public int Location { get; } = location;
public int Component { get; } = component;
public override bool Equals(object other)
{