2024-04-14 22:06:14 +02:00
|
|
|
using System.Buffers;
|
2019-10-13 08:02:07 +02:00
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.GAL
|
|
|
|
{
|
2020-09-10 21:44:04 +02:00
|
|
|
public interface ITexture
|
2019-10-13 08:02:07 +02:00
|
|
|
{
|
2020-07-07 04:41:07 +02:00
|
|
|
int Width { get; }
|
|
|
|
int Height { get; }
|
|
|
|
|
2019-10-31 00:45:01 +01:00
|
|
|
void CopyTo(ITexture destination, int firstLayer, int firstLevel);
|
2021-03-02 23:30:54 +01:00
|
|
|
void CopyTo(ITexture destination, int srcLayer, int dstLayer, int srcLevel, int dstLevel);
|
2019-10-13 08:02:07 +02:00
|
|
|
void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter);
|
2023-05-01 21:05:12 +02:00
|
|
|
void CopyTo(BufferRange range, int layer, int level, int stride);
|
2019-10-13 08:02:07 +02:00
|
|
|
|
|
|
|
ITexture CreateView(TextureCreateInfo info, int firstLayer, int firstLevel);
|
|
|
|
|
2023-03-19 21:56:48 +01:00
|
|
|
PinnedSpan<byte> GetData();
|
|
|
|
PinnedSpan<byte> GetData(int layer, int level);
|
2019-10-13 08:02:07 +02:00
|
|
|
|
2024-04-14 22:06:14 +02: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 15:02:18 +02:00
|
|
|
void SetStorage(BufferRange buffer);
|
2024-04-14 22:06:14 +02:00
|
|
|
|
2020-09-10 21:44:04 +02:00
|
|
|
void Release();
|
2019-10-13 08:02:07 +02:00
|
|
|
}
|
2023-06-28 20:20:10 +02:00
|
|
|
}
|