aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-06-23 20:51:41 -0300
committerGitHub <noreply@github.com>2021-06-24 01:51:41 +0200
commita10b2c5ff26886e9ffc6f19e3f0fe9505a503b2f (patch)
tree006d013c300fb56c94c5563c2c1409a189f794b2 /Ryujinx.HLE/HOS
parent12a7a2ead812d46deb9d978b6758731157be1cbc (diff)
Initial support for GPU channels (#2372)
* Ground work for separate GPU channels * Rename TextureManager to TextureCache * Decouple texture bindings management from the texture cache * Rename BufferManager to BufferCache * Decouple buffer bindings management from the buffer cache * More comments and proper disposal * PR feedback * Force host state update on channel switch * Typo * PR feedback * Missing using
Diffstat (limited to 'Ryujinx.HLE/HOS')
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs29
1 files changed, 17 insertions, 12 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
index 807e0c92..644fc835 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
@@ -1,5 +1,5 @@
-using Ryujinx.Common.Collections;
-using Ryujinx.Common.Logging;
+using Ryujinx.Common.Logging;
+using Ryujinx.Graphics.Gpu;
using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu;
using Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel.Types;
@@ -24,7 +24,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
private readonly Switch _device;
private readonly IVirtualMemoryManager _memory;
- private NvMemoryAllocator _memoryAllocator;
+ private readonly NvMemoryAllocator _memoryAllocator;
+ private readonly GpuChannel _channel;
public enum ResourcePolicy
{
@@ -42,12 +43,13 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
public NvHostChannelDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner)
{
- _device = context.Device;
- _memory = memory;
- _timeout = 3000;
- _submitTimeout = 0;
- _timeslice = 0;
+ _device = context.Device;
+ _memory = memory;
+ _timeout = 3000;
+ _submitTimeout = 0;
+ _timeslice = 0;
_memoryAllocator = _device.MemoryAllocator;
+ _channel = _device.Gpu.CreateChannel();
ChannelSyncpoints = new uint[MaxModuleSyncpoint];
@@ -429,10 +431,10 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
if (header.Flags.HasFlag(SubmitGpfifoFlags.FenceWait) && !_device.System.HostSyncpoint.IsSyncpointExpired(header.Fence.Id, header.Fence.Value))
{
- _device.Gpu.GPFifo.PushHostCommandBuffer(CreateWaitCommandBuffer(header.Fence));
+ _channel.PushHostCommandBuffer(CreateWaitCommandBuffer(header.Fence));
}
- _device.Gpu.GPFifo.PushEntries(entries);
+ _channel.PushEntries(entries);
header.Fence.Id = _channelSyncpoint.Id;
@@ -454,7 +456,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
if (header.Flags.HasFlag(SubmitGpfifoFlags.FenceIncrement))
{
- _device.Gpu.GPFifo.PushHostCommandBuffer(CreateIncrementCommandBuffer(ref header.Fence, header.Flags));
+ _channel.PushHostCommandBuffer(CreateIncrementCommandBuffer(ref header.Fence, header.Flags));
}
header.Flags = SubmitGpfifoFlags.None;
@@ -541,6 +543,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
return commandBuffer;
}
- public override void Close() { }
+ public override void Close()
+ {
+ _channel.Dispose();
+ }
}
}