From 92703af5558258da078d876b1d46e916b1065978 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 1 Jan 2020 12:39:09 -0300 Subject: Address PR feedback --- Ryujinx.Graphics.Gpu/Memory/Buffer.cs | 10 +++++++--- Ryujinx.Graphics.Gpu/Memory/BufferManager.cs | 18 ++++++++++-------- Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs | 2 +- Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs | 8 +++++--- Ryujinx.Graphics.Gpu/Memory/RangeList.cs | 16 ++++++++++++---- 5 files changed, 35 insertions(+), 19 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Memory') diff --git a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs index 8af61d3d..4210ecb9 100644 --- a/Ryujinx.Graphics.Gpu/Memory/Buffer.cs +++ b/Ryujinx.Graphics.Gpu/Memory/Buffer.cs @@ -53,9 +53,11 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Gets a sub-range from the buffer. - /// This can be used to bind and use sub-ranges of the buffer on the host API. /// - /// Start address of the sub-range, must be greater or equal to the buffer address + /// + /// This can be used to bind and use sub-ranges of the buffer on the host API. + /// + /// Start address of the sub-range, must be greater than or equal to the buffer address /// Size in bytes of the sub-range, must be less than or equal to the buffer size /// The buffer sub-range public BufferRange GetRange(ulong address, ulong size) @@ -78,9 +80,11 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Performs guest to host memory synchronization of the buffer data. + /// + /// /// This causes the buffer data to be overwritten if a write was detected from the CPU, /// since the last call to this method. - /// + /// /// Start address of the range to synchronize /// Size in bytes of the range to synchronize public void SynchronizeMemory(ulong address, ulong size) diff --git a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs index 44542349..de56baca 100644 --- a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs +++ b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs @@ -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 /// /// 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. /// public void CommitComputeBindings() { @@ -439,7 +439,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// 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. /// public void CommitBindings() { @@ -543,11 +543,11 @@ namespace Ryujinx.Graphics.Gpu.Memory } /// - /// 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. /// /// Bindings to bind or update /// True to bind, false to update - /// True to bind as storage buffer, false to bind as uniform buffers + /// True to bind as storage buffer, false to bind as uniform buffer 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 /// /// Copy a buffer data from a given address to another. - /// This does a GPU side copy. /// + /// + /// This does a GPU side copy. + /// /// GPU virtual address of the copy source /// GPU virtual address of the copy destination /// Size in bytes of the copy diff --git a/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs b/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs index 3cbbd253..18779333 100644 --- a/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs +++ b/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs @@ -50,7 +50,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// Reads a structure from GPU mapped memory. /// /// Type of the structure - /// GPU virtual address where the strcture is located + /// GPU virtual address where the structure is located /// The structure at the specified memory location public T Read(ulong gpuVa) where T : struct { diff --git a/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs b/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs index 33be04d3..d0171b42 100644 --- a/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs +++ b/Ryujinx.Graphics.Gpu/Memory/MemoryManager.cs @@ -39,8 +39,10 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Maps a given range of pages to the specified CPU virtual address. - /// All addresses and sizes must be page aligned. /// + /// + /// All addresses and sizes must be page aligned. + /// /// CPU virtual address to map into /// GPU virtual address to be mapped /// Size in bytes of the mapping @@ -59,7 +61,7 @@ namespace Ryujinx.Graphics.Gpu.Memory } /// - /// 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. /// /// CPU virtual address to map into @@ -84,7 +86,7 @@ namespace Ryujinx.Graphics.Gpu.Memory } /// - /// 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. /// diff --git a/Ryujinx.Graphics.Gpu/Memory/RangeList.cs b/Ryujinx.Graphics.Gpu/Memory/RangeList.cs index 638108fe..d65814b3 100644 --- a/Ryujinx.Graphics.Gpu/Memory/RangeList.cs +++ b/Ryujinx.Graphics.Gpu/Memory/RangeList.cs @@ -77,9 +77,11 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Gets the first item on the list overlapping in memory with the specified item. + /// + /// /// Despite the name, this has no ordering guarantees of the returned item. /// It only ensures that the item returned overlaps the specified item. - /// + /// /// Item to check for overlaps /// The overlapping item, or the default value for the type if none found public T FindFirstOverlap(T item) @@ -89,9 +91,11 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Gets the first item on the list overlapping the specified memory range. + /// + /// /// Despite the name, this has no ordering guarantees of the returned item. /// It only ensures that the item returned overlaps the specified memory range. - /// + /// /// Start address of the range /// Size in bytes or the rangee /// The overlapping item, or the default value for the type if none found @@ -157,10 +161,12 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Gets all items overlapping with the specified item in memory. + /// + /// /// 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. - /// + /// /// Item to check for overlaps /// Output array where matches will be written. It is automatically resized to fit the results /// The number of overlapping items found @@ -171,10 +177,12 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Gets all items on the list overlapping the specified memory range. + /// + /// /// 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. - /// + /// /// Start address of the range /// Size in bytes or the rangee /// Output array where matches will be written. It is automatically resized to fit the results -- cgit v1.2.3