From 07e68ca6538ca77bf448c58de15f196ae75aae4d Mon Sep 17 00:00:00 2001 From: Gabriel A Date: Sat, 21 Oct 2023 12:10:59 -0300 Subject: [PATCH] Format whitespace --- src/Ryujinx.Graphics.Gpu/Engine/Dma/DmaClass.cs | 2 +- src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Dma/DmaClass.cs b/src/Ryujinx.Graphics.Gpu/Engine/Dma/DmaClass.cs index babd1bf32..679def8df 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/Dma/DmaClass.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/Dma/DmaClass.cs @@ -422,7 +422,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Dma _state.State.SetRemapComponentsComponentSize == SetRemapComponentsComponentSize.Four) { // Fast path for clears when remap is enabled. - bufferCache.ClearBuffer(memoryManager, dstGpuVa, size * 4, _state.State.SetRemapConstA); + BufferCache.ClearBuffer(_context, memoryManager, dstGpuVa, size * 4, _state.State.SetRemapConstA); } else { diff --git a/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs b/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs index 1ac4e2d39..b7948906e 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs @@ -358,21 +358,23 @@ namespace Ryujinx.Graphics.Gpu.Memory /// /// Both the address and size must be aligned to 4 bytes. /// + /// GPU context /// GPU memory manager where the buffer is mapped /// GPU virtual address of the region to clear /// Number of bytes to clear /// Value to be written into the buffer - public void ClearBuffer(MemoryManager memoryManager, ulong gpuVa, ulong size, uint value) + public static void ClearBuffer(GpuContext context, MemoryManager memoryManager, ulong gpuVa, ulong size, uint value) { - ulong address = TranslateAndCreateBuffer(memoryManager, gpuVa, size); + PhysicalMemory physical = memoryManager.GetBackingMemory(gpuVa); - Buffer buffer = GetBuffer(address, size); + ulong address = physical.BufferCache.TranslateAndCreateBuffer(memoryManager, gpuVa, size); + Buffer buffer = physical.BufferCache.GetBuffer(address, size); int offset = (int)(address - buffer.Address); - _context.Renderer.Pipeline.ClearBuffer(buffer.Handle, offset, (int)size, value); + context.Renderer.Pipeline.ClearBuffer(buffer.Handle, offset, (int)size, value); - memoryManager.GetBackingMemory(gpuVa).FillTrackedResource(address, size, value, ResourceKind.Buffer); + physical.FillTrackedResource(address, size, value, ResourceKind.Buffer); } ///