2024-04-14 20:06:14 +00:00
|
|
|
using System.Buffers;
|
2019-10-13 06:02:07 +00:00
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.GAL
|
|
|
|
{
|
2020-09-10 19:44:04 +00:00
|
|
|
public interface ITexture
|
2019-10-13 06:02:07 +00:00
|
|
|
{
|
2020-07-07 02:41:07 +00:00
|
|
|
int Width { get; }
|
|
|
|
int Height { get; }
|
|
|
|
|
2019-10-30 23:45:01 +00:00
|
|
|
void CopyTo(ITexture destination, int firstLayer, int firstLevel);
|
2021-03-02 22:30:54 +00:00
|
|
|
void CopyTo(ITexture destination, int srcLayer, int dstLayer, int srcLevel, int dstLevel);
|
2019-10-13 06:02:07 +00:00
|
|
|
void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter);
|
2023-05-01 19:05:12 +00:00
|
|
|
void CopyTo(BufferRange range, int layer, int level, int stride);
|
2019-10-13 06:02:07 +00:00
|
|
|
|
|
|
|
ITexture CreateView(TextureCreateInfo info, int firstLayer, int firstLevel);
|
|
|
|
|
2023-03-19 20:56:48 +00:00
|
|
|
PinnedSpan<byte> GetData();
|
|
|
|
PinnedSpan<byte> GetData(int layer, int level);
|
2019-10-13 06:02:07 +00:00
|
|
|
|
2024-04-14 20:06:14 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Sets the texture data. The data passed as a <see cref="IMemoryOwner{Byte}" /> will be disposed when
|
|
|
|
/// the operation completes.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="data">Texture data bytes</param>
|
|
|
|
void SetData(IMemoryOwner<byte> data);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the texture data. The data passed as a <see cref="IMemoryOwner{Byte}" /> will be disposed when
|
|
|
|
/// the operation completes.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="data">Texture data bytes</param>
|
|
|
|
/// <param name="layer">Target layer</param>
|
|
|
|
/// <param name="level">Target level</param>
|
|
|
|
void SetData(IMemoryOwner<byte> data, int layer, int level);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the texture data. The data passed as a <see cref="IMemoryOwner{Byte}" /> will be disposed when
|
|
|
|
/// the operation completes.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="data">Texture data bytes</param>
|
|
|
|
/// <param name="layer">Target layer</param>
|
|
|
|
/// <param name="level">Target level</param>
|
|
|
|
/// <param name="region">Target sub-region of the texture to update</param>
|
|
|
|
void SetData(IMemoryOwner<byte> data, int layer, int level, Rectangle<int> region);
|
|
|
|
|
2020-04-25 13:02:18 +00:00
|
|
|
void SetStorage(BufferRange buffer);
|
2024-04-14 20:06:14 +00:00
|
|
|
|
2020-09-10 19:44:04 +00:00
|
|
|
void Release();
|
2019-10-13 06:02:07 +00:00
|
|
|
}
|
2023-06-28 18:20:10 +00:00
|
|
|
}
|