2024-09-19 03:00:54 +01:00
|
|
|
using Ryujinx.Common.Memory;
|
2019-10-13 07:02:07 +01:00
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.GAL
|
|
|
|
{
|
2020-09-10 20:44:04 +01:00
|
|
|
public interface ITexture
|
2019-10-13 07:02:07 +01:00
|
|
|
{
|
2020-07-07 03:41:07 +01: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 07:02:07 +01:00
|
|
|
void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter);
|
2023-05-01 20:05:12 +01:00
|
|
|
void CopyTo(BufferRange range, int layer, int level, int stride);
|
2019-10-13 07:02:07 +01: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 07:02:07 +01:00
|
|
|
|
2024-04-14 21:06:14 +01:00
|
|
|
/// <summary>
|
2024-09-19 03:00:54 +01:00
|
|
|
/// Sets the texture data. The data passed as a <see cref="MemoryOwner{Byte}" /> will be disposed when
|
2024-04-14 21:06:14 +01:00
|
|
|
/// the operation completes.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="data">Texture data bytes</param>
|
2024-09-19 03:00:54 +01:00
|
|
|
void SetData(MemoryOwner<byte> data);
|
2024-04-14 21:06:14 +01:00
|
|
|
|
|
|
|
/// <summary>
|
2024-09-19 03:00:54 +01:00
|
|
|
/// Sets the texture data. The data passed as a <see cref="MemoryOwner{Byte}" /> will be disposed when
|
2024-04-14 21:06:14 +01: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-19 03:00:54 +01:00
|
|
|
void SetData(MemoryOwner<byte> data, int layer, int level);
|
2024-04-14 21:06:14 +01:00
|
|
|
|
|
|
|
/// <summary>
|
2024-09-19 03:00:54 +01:00
|
|
|
/// Sets the texture data. The data passed as a <see cref="MemoryOwner{Byte}" /> will be disposed when
|
2024-04-14 21:06:14 +01: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-19 03:00:54 +01:00
|
|
|
void SetData(MemoryOwner<byte> data, int layer, int level, Rectangle<int> region);
|
2024-04-14 21:06:14 +01:00
|
|
|
|
2020-04-25 14:02:18 +01:00
|
|
|
void SetStorage(BufferRange buffer);
|
2024-04-14 21:06:14 +01:00
|
|
|
|
2020-09-10 20:44:04 +01:00
|
|
|
void Release();
|
2019-10-13 07:02:07 +01:00
|
|
|
}
|
2023-06-28 19:20:10 +01:00
|
|
|
}
|