From 32764f95602611e9daa50362330d760e8ed83fda Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 29 Dec 2019 20:26:37 -0300 Subject: Add XML documentation to Ryujinx.Graphics.Gpu.Image --- Ryujinx.Graphics.Gpu/Image/Pool.cs | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Gpu/Image/Pool.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/Pool.cs b/Ryujinx.Graphics.Gpu/Image/Pool.cs index 5ce8d7f6..bb55d40e 100644 --- a/Ryujinx.Graphics.Gpu/Image/Pool.cs +++ b/Ryujinx.Graphics.Gpu/Image/Pool.cs @@ -3,6 +3,10 @@ using System; namespace Ryujinx.Graphics.Gpu.Image { + /// + /// Represents a pool of GPU resources, such as samplers or textures. + /// + /// GPU resource type abstract class Pool : IDisposable { protected const int DescriptorSize = 0x20; @@ -11,10 +15,21 @@ namespace Ryujinx.Graphics.Gpu.Image protected T[] Items; + /// + /// The maximum ID value of resources on the pool (inclusive). + /// The maximum amount of resources on the pool is equal to this value plus one. + /// public int MaximumId { get; } + /// + /// The address of the pool in guest memory. + /// public ulong Address { get; } - public ulong Size { get; } + + /// + /// The size of the pool in bytes. + /// + public ulong Size { get; } public Pool(GpuContext context, ulong address, int maximumId) { @@ -31,8 +46,18 @@ namespace Ryujinx.Graphics.Gpu.Image Size = size; } + /// + /// Gets the GPU resource with the given ID. + /// + /// ID of the resource. This is effectively a zero-based index + /// The GPU resource with the given ID public abstract T Get(int id); + /// + /// Synchronizes host memory with guest memory. + /// This causes a invalidation of pool entries, + /// if a modification of entries by the CPU is detected. + /// public void SynchronizeMemory() { (ulong, ulong)[] modifiedRanges = Context.PhysicalMemory.GetModifiedRanges(Address, Size, ResourceName.TexturePool); @@ -57,6 +82,13 @@ namespace Ryujinx.Graphics.Gpu.Image } } + /// + /// Invalidates a range of memory of the GPU resource pool. + /// Entries that falls inside the speicified range will be invalidated, + /// causing all the data to be reloaded from guest memory. + /// + /// The start address of the range to invalidate + /// The size of the range to invalidate public void InvalidateRange(ulong address, ulong size) { ulong endAddress = address + size; @@ -80,6 +112,8 @@ namespace Ryujinx.Graphics.Gpu.Image endAddress = texturePoolEndAddress; } + size = endAddress - address; + InvalidateRangeImpl(address, size); } @@ -87,6 +121,10 @@ namespace Ryujinx.Graphics.Gpu.Image protected abstract void Delete(T item); + /// + /// Performs the disposal of all resources stored on the pool. + /// It's an error to try using the pool after disposal. + /// public void Dispose() { if (Items != null) -- cgit v1.2.3