Address PR feedback

This commit is contained in:
gdkchan 2020-01-01 12:39:09 -03:00 committed by Thog
parent 40ef18d759
commit 92703af555
39 changed files with 285 additions and 228 deletions

View file

@ -53,9 +53,11 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Gets a sub-range from the buffer.
/// This can be used to bind and use sub-ranges of the buffer on the host API.
/// </summary>
/// <param name="address">Start address of the sub-range, must be greater or equal to the buffer address</param>
/// <remarks>
/// This can be used to bind and use sub-ranges of the buffer on the host API.
/// </remarks>
/// <param name="address">Start address of the sub-range, must be greater than or equal to the buffer address</param>
/// <param name="size">Size in bytes of the sub-range, must be less than or equal to the buffer size</param>
/// <returns>The buffer sub-range</returns>
public BufferRange GetRange(ulong address, ulong size)
@ -78,9 +80,11 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Performs guest to host memory synchronization of the buffer data.
/// </summary>
/// <remarks>
/// This causes the buffer data to be overwritten if a write was detected from the CPU,
/// since the last call to this method.
/// </summary>
/// </remarks>
/// <param name="address">Start address of the range to synchronize</param>
/// <param name="size">Size in bytes of the range to synchronize</param>
public void SynchronizeMemory(ulong address, ulong size)

View file

@ -76,10 +76,10 @@ namespace Ryujinx.Graphics.Gpu.Memory
_cpStorageBuffers = new BuffersPerStage(Constants.TotalCpStorageBuffers);
_cpUniformBuffers = new BuffersPerStage(Constants.TotalCpUniformBuffers);
_gpStorageBuffers = new BuffersPerStage[Constants.TotalShaderStages];
_gpUniformBuffers = new BuffersPerStage[Constants.TotalShaderStages];
_gpStorageBuffers = new BuffersPerStage[Constants.ShaderStages];
_gpUniformBuffers = new BuffersPerStage[Constants.ShaderStages];
for (int index = 0; index < Constants.TotalShaderStages; index++)
for (int index = 0; index < Constants.ShaderStages; index++)
{
_gpStorageBuffers[index] = new BuffersPerStage(Constants.TotalGpStorageBuffers);
_gpUniformBuffers[index] = new BuffersPerStage(Constants.TotalGpUniformBuffers);
@ -387,7 +387,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Ensures that the compute engine bindings are visible to the host GPU.
/// This actually performs the binding using the host graphics API.
/// Note: this actually performs the binding using the host graphics API.
/// </summary>
public void CommitComputeBindings()
{
@ -439,7 +439,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Ensures that the graphics engine bindings are visible to the host GPU.
/// This actually performs the binding using the host graphics API.
/// Note: this actually performs the binding using the host graphics API.
/// </summary>
public void CommitBindings()
{
@ -543,11 +543,11 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
/// <summary>
/// This binds buffer into the host API, or updates data for already bound buffers.
/// This binds buffers into the host API, or updates data for already bound buffers.
/// </summary>
/// <param name="bindings">Bindings to bind or update</param>
/// <param name="bind">True to bind, false to update</param>
/// <param name="isStorage">True to bind as storage buffer, false to bind as uniform buffers</param>
/// <param name="isStorage">True to bind as storage buffer, false to bind as uniform buffer</param>
private void BindOrUpdateBuffers(BuffersPerStage[] bindings, bool bind, bool isStorage = false)
{
for (ShaderStage stage = ShaderStage.Vertex; stage <= ShaderStage.Fragment; stage++)
@ -608,8 +608,10 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Copy a buffer data from a given address to another.
/// This does a GPU side copy.
/// </summary>
/// <remarks>
/// This does a GPU side copy.
/// </remarks>
/// <param name="srcVa">GPU virtual address of the copy source</param>
/// <param name="dstVa">GPU virtual address of the copy destination</param>
/// <param name="size">Size in bytes of the copy</param>

View file

@ -50,7 +50,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// Reads a structure from GPU mapped memory.
/// </summary>
/// <typeparam name="T">Type of the structure</typeparam>
/// <param name="gpuVa">GPU virtual address where the strcture is located</param>
/// <param name="gpuVa">GPU virtual address where the structure is located</param>
/// <returns>The structure at the specified memory location</returns>
public T Read<T>(ulong gpuVa) where T : struct
{

View file

@ -39,8 +39,10 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Maps a given range of pages to the specified CPU virtual address.
/// All addresses and sizes must be page aligned.
/// </summary>
/// <remarks>
/// All addresses and sizes must be page aligned.
/// </remarks>
/// <param name="pa">CPU virtual address to map into</param>
/// <param name="va">GPU virtual address to be mapped</param>
/// <param name="size">Size in bytes of the mapping</param>
@ -59,7 +61,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
/// <summary>
/// Maps a given range of pages to a allocated GPU virtual address.
/// Maps a given range of pages to an allocated GPU virtual address.
/// The memory is automatically allocated by the memory manager.
/// </summary>
/// <param name="pa">CPU virtual address to map into</param>
@ -84,7 +86,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
/// <summary>
/// Maps a given range of pages to a allocated GPU virtual address.
/// Maps a given range of pages to an allocated GPU virtual address.
/// The memory is automatically allocated by the memory manager.
/// This also ensures that the mapping is always done in the first 4GB of GPU address space.
/// </summary>

View file

@ -77,9 +77,11 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Gets the first item on the list overlapping in memory with the specified item.
/// </summary>
/// <remarks>
/// Despite the name, this has no ordering guarantees of the returned item.
/// It only ensures that the item returned overlaps the specified item.
/// </summary>
/// </remarks>
/// <param name="item">Item to check for overlaps</param>
/// <returns>The overlapping item, or the default value for the type if none found</returns>
public T FindFirstOverlap(T item)
@ -89,9 +91,11 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Gets the first item on the list overlapping the specified memory range.
/// </summary>
/// <remarks>
/// Despite the name, this has no ordering guarantees of the returned item.
/// It only ensures that the item returned overlaps the specified memory range.
/// </summary>
/// </remarks>
/// <param name="address">Start address of the range</param>
/// <param name="size">Size in bytes or the rangee</param>
/// <returns>The overlapping item, or the default value for the type if none found</returns>
@ -157,10 +161,12 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Gets all items overlapping with the specified item in memory.
/// </summary>
/// <remarks>
/// This method only returns correct results if none of the items on the list overlaps with
/// each other. If that is not the case, this method should not be used.
/// This method is faster than the regular method to find all overlaps.
/// </summary>
/// </remarks>
/// <param name="item">Item to check for overlaps</param>
/// <param name="output">Output array where matches will be written. It is automatically resized to fit the results</param>
/// <returns>The number of overlapping items found</returns>
@ -171,10 +177,12 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <summary>
/// Gets all items on the list overlapping the specified memory range.
/// </summary>
/// <remarks>
/// This method only returns correct results if none of the items on the list overlaps with
/// each other. If that is not the case, this method should not be used.
/// This method is faster than the regular method to find all overlaps.
/// </summary>
/// </remarks>
/// <param name="address">Start address of the range</param>
/// <param name="size">Size in bytes or the rangee</param>
/// <param name="output">Output array where matches will be written. It is automatically resized to fit the results</param>