Format whitespace

This commit is contained in:
Gabriel A 2023-10-21 12:10:59 -03:00
parent 4d3f5e3818
commit 07e68ca653
2 changed files with 8 additions and 6 deletions

View file

@ -422,7 +422,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Dma
_state.State.SetRemapComponentsComponentSize == SetRemapComponentsComponentSize.Four) _state.State.SetRemapComponentsComponentSize == SetRemapComponentsComponentSize.Four)
{ {
// Fast path for clears when remap is enabled. // 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 else
{ {

View file

@ -358,21 +358,23 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <remarks> /// <remarks>
/// Both the address and size must be aligned to 4 bytes. /// Both the address and size must be aligned to 4 bytes.
/// </remarks> /// </remarks>
/// <param name="context">GPU context</param>
/// <param name="memoryManager">GPU memory manager where the buffer is mapped</param> /// <param name="memoryManager">GPU memory manager where the buffer is mapped</param>
/// <param name="gpuVa">GPU virtual address of the region to clear</param> /// <param name="gpuVa">GPU virtual address of the region to clear</param>
/// <param name="size">Number of bytes to clear</param> /// <param name="size">Number of bytes to clear</param>
/// <param name="value">Value to be written into the buffer</param> /// <param name="value">Value to be written into the buffer</param>
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); 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);
} }
/// <summary> /// <summary>