Support for resources on non-contiguous GPU memory regions (#1905)
* Support for resources on non-contiguous GPU memory regions * Implement MultiRange physical addresses, only used with a single range for now * Actually use non-contiguous ranges * GetPhysicalRegions fixes * Documentation and remove Address property from TextureInfo * Finish implementing GetWritableRegion * Fix typo
This commit is contained in:
parent
3bad321d2b
commit
c4f56c5704
18 changed files with 1141 additions and 167 deletions
60
Ryujinx.Graphics.Gpu/Memory/GpuRegionHandle.cs
Normal file
60
Ryujinx.Graphics.Gpu/Memory/GpuRegionHandle.cs
Normal file
|
@ -0,0 +1,60 @@
|
|||
using Ryujinx.Cpu.Tracking;
|
||||
using Ryujinx.Memory.Tracking;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Memory
|
||||
{
|
||||
class GpuRegionHandle : IRegionHandle
|
||||
{
|
||||
private readonly CpuRegionHandle[] _cpuRegionHandles;
|
||||
|
||||
public bool Dirty
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (var regionHandle in _cpuRegionHandles)
|
||||
{
|
||||
if (regionHandle.Dirty)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public ulong Address => throw new NotSupportedException();
|
||||
public ulong Size => throw new NotSupportedException();
|
||||
public ulong EndAddress => throw new NotSupportedException();
|
||||
|
||||
public GpuRegionHandle(CpuRegionHandle[] cpuRegionHandles)
|
||||
{
|
||||
_cpuRegionHandles = cpuRegionHandles;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var regionHandle in _cpuRegionHandles)
|
||||
{
|
||||
regionHandle.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterAction(RegionSignal action)
|
||||
{
|
||||
foreach (var regionHandle in _cpuRegionHandles)
|
||||
{
|
||||
regionHandle.RegisterAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
public void Reprotect()
|
||||
{
|
||||
foreach (var regionHandle in _cpuRegionHandles)
|
||||
{
|
||||
regionHandle.Reprotect();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue