2021-01-17 21:08:06 +01:00
|
|
|
using Ryujinx.Graphics.Shader;
|
2023-12-04 20:30:19 +01:00
|
|
|
using Ryujinx.Memory.Range;
|
2021-01-17 21:08:06 +01:00
|
|
|
|
2019-10-13 08:02:07 +02:00
|
|
|
namespace Ryujinx.Graphics.Gpu.Memory
|
|
|
|
{
|
2019-12-31 04:22:58 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Memory range used for buffers.
|
|
|
|
/// </summary>
|
2022-12-05 14:47:39 +01:00
|
|
|
readonly struct BufferBounds
|
2019-10-13 08:02:07 +02:00
|
|
|
{
|
2020-11-08 12:10:00 +01:00
|
|
|
/// <summary>
|
2023-12-04 20:30:19 +01:00
|
|
|
/// Physical memory ranges where the buffer is mapped.
|
2020-11-08 12:10:00 +01:00
|
|
|
/// </summary>
|
2023-12-04 20:30:19 +01:00
|
|
|
public MultiRange Range { get; }
|
2020-11-08 12:10:00 +01:00
|
|
|
|
|
|
|
/// <summary>
|
2023-12-04 20:30:19 +01:00
|
|
|
/// Buffer usage flags.
|
2020-11-08 12:10:00 +01:00
|
|
|
/// </summary>
|
2023-12-04 20:30:19 +01:00
|
|
|
public BufferUsageFlags Flags { get; }
|
2020-11-08 12:10:00 +01:00
|
|
|
|
2021-01-17 21:08:06 +01:00
|
|
|
/// <summary>
|
2023-12-04 20:30:19 +01:00
|
|
|
/// Indicates that the backing memory for the buffer does not exist.
|
2021-01-17 21:08:06 +01:00
|
|
|
/// </summary>
|
2023-12-04 20:30:19 +01:00
|
|
|
public bool IsUnmapped => Range.IsUnmapped;
|
2021-01-17 21:08:06 +01:00
|
|
|
|
2020-11-08 12:10:00 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new buffer region.
|
|
|
|
/// </summary>
|
2023-12-04 20:30:19 +01:00
|
|
|
/// <param name="range">Physical memory ranges where the buffer is mapped</param>
|
2021-01-17 21:08:06 +01:00
|
|
|
/// <param name="flags">Buffer usage flags</param>
|
2023-12-04 20:30:19 +01:00
|
|
|
public BufferBounds(MultiRange range, BufferUsageFlags flags = BufferUsageFlags.None)
|
2020-11-08 12:10:00 +01:00
|
|
|
{
|
2023-12-04 20:30:19 +01:00
|
|
|
Range = range;
|
2021-01-17 21:08:06 +01:00
|
|
|
Flags = flags;
|
2020-11-08 12:10:00 +01:00
|
|
|
}
|
2019-10-13 08:02:07 +02:00
|
|
|
}
|
2023-07-02 02:47:54 +02:00
|
|
|
}
|