mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-12-23 12:36:25 +00:00
test
This commit is contained in:
parent
be1a05dead
commit
01f43cafea
@ -2,6 +2,7 @@ using Ryujinx.Graphics.GAL;
|
|||||||
using Ryujinx.Memory.Range;
|
using Ryujinx.Memory.Range;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Gpu.Memory
|
namespace Ryujinx.Graphics.Gpu.Memory
|
||||||
@ -595,6 +596,8 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
}
|
}
|
||||||
while (oldOverlapCount != overlaps.Length);
|
while (oldOverlapCount != overlaps.Length);
|
||||||
|
|
||||||
|
Debug.Assert(endAddress == overlaps[^1].EndAddress);
|
||||||
|
|
||||||
ulong newSize = endAddress - address;
|
ulong newSize = endAddress - address;
|
||||||
|
|
||||||
Buffer[] overlapsArray = overlaps.ToArray();
|
Buffer[] overlapsArray = overlaps.ToArray();
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Memory.Range;
|
using Ryujinx.Memory.Range;
|
||||||
using System;
|
using System;
|
||||||
using System.Buffers;
|
using System.Buffers;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Gpu.Memory
|
namespace Ryujinx.Graphics.Gpu.Memory
|
||||||
@ -157,6 +159,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
public void SignalModified(ulong address, ulong size)
|
public void SignalModified(ulong address, ulong size)
|
||||||
{
|
{
|
||||||
ulong endAddress = address + size;
|
ulong endAddress = address + size;
|
||||||
|
|
||||||
|
Debug.Assert(endAddress <= _parent.EndAddress);
|
||||||
|
|
||||||
ulong syncNumber = _context.SyncNumber;
|
ulong syncNumber = _context.SyncNumber;
|
||||||
// We may overlap with some existing modified regions. They must be cut into by the new entry.
|
// We may overlap with some existing modified regions. They must be cut into by the new entry.
|
||||||
Lock.EnterWriteLock();
|
Lock.EnterWriteLock();
|
||||||
@ -169,6 +174,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.Warning?.Print(LogClass.Gpu, "Signal Modified");
|
||||||
if (first == last)
|
if (first == last)
|
||||||
{
|
{
|
||||||
if (first.Address == address && first.EndAddress == endAddress)
|
if (first.Address == address && first.EndAddress == endAddress)
|
||||||
@ -460,10 +466,14 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
/// <param name="registerRangeAction">The action to call for each modified range</param>
|
/// <param name="registerRangeAction">The action to call for each modified range</param>
|
||||||
public void InheritRanges(BufferModifiedRangeList ranges, Action<ulong, ulong> registerRangeAction)
|
public void InheritRanges(BufferModifiedRangeList ranges, Action<ulong, ulong> registerRangeAction)
|
||||||
{
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Gpu, "Inherit Ranges");
|
||||||
ranges.Lock.EnterReadLock();
|
ranges.Lock.EnterReadLock();
|
||||||
BufferModifiedRange[] inheritRanges = ranges.ToArray();
|
BufferModifiedRange[] inheritRanges = new BufferModifiedRange[ranges.Count];
|
||||||
|
ranges.Items.AsSpan(0, ranges.Count).CopyTo(inheritRanges);
|
||||||
ranges.Lock.ExitReadLock();
|
ranges.Lock.ExitReadLock();
|
||||||
|
|
||||||
|
Debug.Assert(_parent.Address <= ranges._parent.Address && _parent.EndAddress >= ranges._parent.EndAddress);
|
||||||
|
|
||||||
// Copy over the migration from the previous range list
|
// Copy over the migration from the previous range list
|
||||||
|
|
||||||
BufferMigration oldMigration = ranges._source;
|
BufferMigration oldMigration = ranges._source;
|
||||||
@ -490,6 +500,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
|
|
||||||
foreach (BufferModifiedRange range in inheritRanges)
|
foreach (BufferModifiedRange range in inheritRanges)
|
||||||
{
|
{
|
||||||
|
Debug.Assert(range.EndAddress <= _parent.EndAddress);
|
||||||
Add(range);
|
Add(range);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,6 +556,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
{
|
{
|
||||||
// If the overlap extends outside of the clear range, make sure those parts still exist.
|
// If the overlap extends outside of the clear range, make sure those parts still exist.
|
||||||
|
|
||||||
|
Logger.Warning?.Print(LogClass.Gpu, "Clear Part");
|
||||||
if (overlap.Address < address)
|
if (overlap.Address < address)
|
||||||
{
|
{
|
||||||
if (overlap.EndAddress > endAddress)
|
if (overlap.EndAddress > endAddress)
|
||||||
@ -572,6 +584,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
|
|||||||
/// <param name="size">Size to clear</param>
|
/// <param name="size">Size to clear</param>
|
||||||
public void Clear(ulong address, ulong size)
|
public void Clear(ulong address, ulong size)
|
||||||
{
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Gpu, "Clear");
|
||||||
ulong endAddress = address + size;
|
ulong endAddress = address + size;
|
||||||
Lock.EnterWriteLock();
|
Lock.EnterWriteLock();
|
||||||
(BufferModifiedRange first, BufferModifiedRange last) = FindOverlapsAsNodes(address, size);
|
(BufferModifiedRange first, BufferModifiedRange last) = FindOverlapsAsNodes(address, size);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user