SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

46 lines
1.5 KiB

using System;
using System.Runtime.InteropServices;
namespace UnityEngine.XR.ARKit
{
[StructLayout(LayoutKind.Sequential)]
internal struct MemoryLayout : IEquatable<MemoryLayout>
{
/// <summary>
/// The number of bytes required to store a single session relative data object
/// </summary>
public int size;
/// <summary>
/// The number of bytes between consecutive elements in an array of session relative data objects
/// </summary>
public int stride;
/// <summary>
/// The alignment required by a session relative data object
/// </summary>
public int alignment;
public override int GetHashCode()
{
unchecked
{
int hash = size.GetHashCode();
hash = hash * 486187739 + stride.GetHashCode();
hash = hash * 486187739 + alignment.GetHashCode();
return hash;
}
}
public bool Equals(MemoryLayout other)
{
return
(size == other.size) &&
(stride == other.stride) &&
(alignment == other.alignment);
}
public override bool Equals(object obj) => (obj is MemoryLayout) && Equals((MemoryLayout)obj);
public static bool operator ==(MemoryLayout lhs, MemoryLayout rhs) => lhs.Equals(rhs);
public static bool operator !=(MemoryLayout lhs, MemoryLayout rhs) => !lhs.Equals(rhs);
}
}