2019-10-12 23:02:07 -07:00
|
|
|
namespace Ryujinx.Graphics.Gpu.Image
|
|
|
|
{
|
2019-12-29 15:26:37 -08:00
|
|
|
/// <summary>
|
|
|
|
/// Texture pool cache.
|
|
|
|
/// This can keep multiple texture pools, and return the current one as needed.
|
|
|
|
/// It is useful for applications that uses multiple texture pools.
|
|
|
|
/// </summary>
|
2022-07-27 17:07:48 -07:00
|
|
|
class TexturePoolCache : PoolCache<TexturePool>
|
2019-10-12 23:02:07 -07:00
|
|
|
{
|
2019-12-29 15:26:37 -08:00
|
|
|
/// <summary>
|
|
|
|
/// Constructs a new instance of the texture pool.
|
|
|
|
/// </summary>
|
2020-01-01 15:14:18 -08:00
|
|
|
/// <param name="context">GPU context that the texture pool belongs to</param>
|
2022-07-27 17:07:48 -07:00
|
|
|
public TexturePoolCache(GpuContext context) : base(context)
|
2019-10-12 23:02:07 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-12-29 15:26:37 -08:00
|
|
|
/// <summary>
|
2022-07-27 17:07:48 -07:00
|
|
|
/// Creates a new instance of the texture pool.
|
2019-12-29 15:26:37 -08:00
|
|
|
/// </summary>
|
2022-07-27 17:07:48 -07:00
|
|
|
/// <param name="context">GPU context that the texture pool belongs to</param>
|
|
|
|
/// <param name="channel">GPU channel that the texture pool belongs to</param>
|
|
|
|
/// <param name="address">Address of the texture pool in guest memory</param>
|
|
|
|
/// <param name="maximumId">Maximum texture ID of the texture pool (equal to maximum textures minus one)</param>
|
|
|
|
protected override TexturePool CreatePool(GpuContext context, GpuChannel channel, ulong address, int maximumId)
|
2019-10-12 23:02:07 -07:00
|
|
|
{
|
2022-07-27 17:07:48 -07:00
|
|
|
return new TexturePool(context, channel, address, maximumId);
|
2019-10-12 23:02:07 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|