VertexAttribDescriptor.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. namespace Ryujinx.Graphics.GAL
  3. {
  4. public struct VertexAttribDescriptor : IEquatable<VertexAttribDescriptor>
  5. {
  6. public int BufferIndex { get; }
  7. public int Offset { get; }
  8. public bool IsZero { get; }
  9. public Format Format { get; }
  10. public VertexAttribDescriptor(int bufferIndex, int offset, bool isZero, Format format)
  11. {
  12. BufferIndex = bufferIndex;
  13. Offset = offset;
  14. IsZero = isZero;
  15. Format = format;
  16. }
  17. public override bool Equals(object obj)
  18. {
  19. return obj is VertexAttribDescriptor other && Equals(other);
  20. }
  21. public bool Equals(VertexAttribDescriptor other)
  22. {
  23. return BufferIndex == other.BufferIndex &&
  24. Offset == other.Offset &&
  25. IsZero == other.IsZero &&
  26. Format == other.Format;
  27. }
  28. public override int GetHashCode()
  29. {
  30. return HashCode.Combine(BufferIndex, Offset, IsZero, Format);
  31. }
  32. }
  33. }