diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/ShaderAddresses.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Shader/ShaderAddresses.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/ShaderAddresses.cs b/Ryujinx.Graphics.Gpu/Shader/ShaderAddresses.cs index 39bf10fa..651dfd26 100644 --- a/Ryujinx.Graphics.Gpu/Shader/ShaderAddresses.cs +++ b/Ryujinx.Graphics.Gpu/Shader/ShaderAddresses.cs @@ -1,4 +1,6 @@ using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; namespace Ryujinx.Graphics.Gpu.Shader { @@ -9,7 +11,7 @@ namespace Ryujinx.Graphics.Gpu.Shader { #pragma warning disable CS0649 public ulong VertexA; - public ulong Vertex; + public ulong VertexB; public ulong TessControl; public ulong TessEvaluation; public ulong Geometry; @@ -34,7 +36,7 @@ namespace Ryujinx.Graphics.Gpu.Shader public bool Equals(ShaderAddresses other) { return VertexA == other.VertexA && - Vertex == other.Vertex && + VertexB == other.VertexB && TessControl == other.TessControl && TessEvaluation == other.TessEvaluation && Geometry == other.Geometry && @@ -47,7 +49,16 @@ namespace Ryujinx.Graphics.Gpu.Shader /// <returns>Hash code</returns> public override int GetHashCode() { - return HashCode.Combine(VertexA, Vertex, TessControl, TessEvaluation, Geometry, Fragment); + return HashCode.Combine(VertexA, VertexB, TessControl, TessEvaluation, Geometry, Fragment); + } + + /// <summary> + /// Gets a view of the structure as a span of addresses. + /// </summary> + /// <returns>Span of addresses</returns> + public Span<ulong> AsSpan() + { + return MemoryMarshal.CreateSpan(ref VertexA, Unsafe.SizeOf<ShaderAddresses>() / sizeof(ulong)); } } }
\ No newline at end of file |