2021-01-26 14:44:07 -07:00
|
|
|
using System;
|
|
|
|
|
2019-12-29 10:41:50 -07:00
|
|
|
namespace Ryujinx.Graphics.GAL
|
2019-10-13 00:02:07 -06:00
|
|
|
{
|
2021-01-26 14:44:07 -07:00
|
|
|
public struct VertexAttribDescriptor : IEquatable<VertexAttribDescriptor>
|
2019-10-13 00:02:07 -06:00
|
|
|
{
|
2020-01-05 18:04:37 -07:00
|
|
|
public int BufferIndex { get; }
|
|
|
|
public int Offset { get; }
|
2019-10-13 00:02:07 -06:00
|
|
|
|
2020-03-29 20:11:24 -06:00
|
|
|
public bool IsZero { get; }
|
|
|
|
|
2019-10-13 00:02:07 -06:00
|
|
|
public Format Format { get; }
|
|
|
|
|
2020-03-29 20:11:24 -06:00
|
|
|
public VertexAttribDescriptor(int bufferIndex, int offset, bool isZero, Format format)
|
2019-10-13 00:02:07 -06:00
|
|
|
{
|
|
|
|
BufferIndex = bufferIndex;
|
|
|
|
Offset = offset;
|
2020-03-29 20:11:24 -06:00
|
|
|
IsZero = isZero;
|
2019-10-13 00:02:07 -06:00
|
|
|
Format = format;
|
|
|
|
}
|
2021-01-26 14:44:07 -07:00
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
{
|
|
|
|
return obj is VertexAttribDescriptor other && Equals(other);
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool Equals(VertexAttribDescriptor other)
|
|
|
|
{
|
|
|
|
return BufferIndex == other.BufferIndex &&
|
|
|
|
Offset == other.Offset &&
|
|
|
|
IsZero == other.IsZero &&
|
|
|
|
Format == other.Format;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
{
|
|
|
|
return HashCode.Combine(BufferIndex, Offset, IsZero, Format);
|
|
|
|
}
|
2019-10-13 00:02:07 -06:00
|
|
|
}
|
|
|
|
}
|