using System;
namespace Ryujinx.Graphics.Gpu.Shader
{
#pragma warning disable CS0659 // Class overrides Object.Equals(object o) but does not override Object.GetHashCode()
///
/// State used by the .
///
readonly struct GpuChannelPoolState : IEquatable
{
///
/// GPU virtual address of the texture pool.
///
public readonly ulong TexturePoolGpuVa;
///
/// Maximum ID of the texture pool.
///
public readonly int TexturePoolMaximumId;
///
/// Constant buffer slot where the texture handles are located.
///
public readonly int TextureBufferIndex;
///
/// Creates a new GPU texture pool state.
///
/// GPU virtual address of the texture pool
/// Maximum ID of the texture pool
/// Constant buffer slot where the texture handles are located
public GpuChannelPoolState(ulong texturePoolGpuVa, int texturePoolMaximumId, int textureBufferIndex)
{
TexturePoolGpuVa = texturePoolGpuVa;
TexturePoolMaximumId = texturePoolMaximumId;
TextureBufferIndex = textureBufferIndex;
}
///
/// Check if the pool states are equal.
///
/// Pool state to compare with
/// True if they are equal, false otherwise
public bool Equals(GpuChannelPoolState other)
{
return TexturePoolGpuVa == other.TexturePoolGpuVa &&
TexturePoolMaximumId == other.TexturePoolMaximumId &&
TextureBufferIndex == other.TextureBufferIndex;
}
public override bool Equals(object obj)
{
return obj is GpuChannelPoolState state && Equals(state);
}
}
#pragma warning restore CS0659
}