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