Move solution and projects to src
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Model;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct ActionCommand : IGALCommand, IGALCommand<ActionCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.Action;
|
||||
private TableRef<Action> _action;
|
||||
|
||||
public void Set(TableRef<Action> action)
|
||||
{
|
||||
_action = action;
|
||||
}
|
||||
|
||||
public static void Run(ref ActionCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
command._action.Get(threaded)();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateBufferCommand : IGALCommand, IGALCommand<CreateBufferCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateBuffer;
|
||||
private BufferHandle _threadedHandle;
|
||||
private int _size;
|
||||
private BufferHandle _storageHint;
|
||||
|
||||
public void Set(BufferHandle threadedHandle, int size, BufferHandle storageHint)
|
||||
{
|
||||
_threadedHandle = threadedHandle;
|
||||
_size = size;
|
||||
_storageHint = storageHint;
|
||||
}
|
||||
|
||||
public static void Run(ref CreateBufferCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
BufferHandle hint = BufferHandle.Null;
|
||||
|
||||
if (command._storageHint != BufferHandle.Null)
|
||||
{
|
||||
hint = threaded.Buffers.MapBuffer(command._storageHint);
|
||||
}
|
||||
|
||||
threaded.Buffers.AssignBuffer(command._threadedHandle, renderer.CreateBuffer(command._size, hint));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Model;
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Resources.Programs;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateProgramCommand : IGALCommand, IGALCommand<CreateProgramCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateProgram;
|
||||
private TableRef<IProgramRequest> _request;
|
||||
|
||||
public void Set(TableRef<IProgramRequest> request)
|
||||
{
|
||||
_request = request;
|
||||
}
|
||||
|
||||
public static void Run(ref CreateProgramCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
IProgramRequest request = command._request.Get(threaded);
|
||||
|
||||
if (request.Threaded.Base == null)
|
||||
{
|
||||
request.Threaded.Base = request.Create(renderer);
|
||||
}
|
||||
|
||||
threaded.Programs.ProcessQueue();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Model;
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateSamplerCommand : IGALCommand, IGALCommand<CreateSamplerCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateSampler;
|
||||
private TableRef<ThreadedSampler> _sampler;
|
||||
private SamplerCreateInfo _info;
|
||||
|
||||
public void Set(TableRef<ThreadedSampler> sampler, SamplerCreateInfo info)
|
||||
{
|
||||
_sampler = sampler;
|
||||
_info = info;
|
||||
}
|
||||
|
||||
public static void Run(ref CreateSamplerCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
command._sampler.Get(threaded).Base = renderer.CreateSampler(command._info);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateSyncCommand : IGALCommand, IGALCommand<CreateSyncCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateSync;
|
||||
private ulong _id;
|
||||
private bool _strict;
|
||||
|
||||
public void Set(ulong id, bool strict)
|
||||
{
|
||||
_id = id;
|
||||
_strict = strict;
|
||||
}
|
||||
|
||||
public static void Run(ref CreateSyncCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
renderer.CreateSync(command._id, command._strict);
|
||||
|
||||
threaded.Sync.AssignSync(command._id);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Model;
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct CreateTextureCommand : IGALCommand, IGALCommand<CreateTextureCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.CreateTexture;
|
||||
private TableRef<ThreadedTexture> _texture;
|
||||
private TextureCreateInfo _info;
|
||||
private float _scale;
|
||||
|
||||
public void Set(TableRef<ThreadedTexture> texture, TextureCreateInfo info, float scale)
|
||||
{
|
||||
_texture = texture;
|
||||
_info = info;
|
||||
_scale = scale;
|
||||
}
|
||||
|
||||
public static void Run(ref CreateTextureCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
command._texture.Get(threaded).Base = renderer.CreateTexture(command._info, command._scale);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Model;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct GetCapabilitiesCommand : IGALCommand, IGALCommand<GetCapabilitiesCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.GetCapabilities;
|
||||
private TableRef<ResultBox<Capabilities>> _result;
|
||||
|
||||
public void Set(TableRef<ResultBox<Capabilities>> result)
|
||||
{
|
||||
_result = result;
|
||||
}
|
||||
|
||||
public static void Run(ref GetCapabilitiesCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
command._result.Get(threaded).Result = renderer.GetCapabilities();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct PreFrameCommand : IGALCommand, IGALCommand<PreFrameCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.PreFrame;
|
||||
|
||||
public static void Run(ref PreFrameCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
renderer.PreFrame();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Model;
|
||||
using Ryujinx.Graphics.GAL.Multithreading.Resources;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct ReportCounterCommand : IGALCommand, IGALCommand<ReportCounterCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ReportCounter;
|
||||
private TableRef<ThreadedCounterEvent> _event;
|
||||
private CounterType _type;
|
||||
private TableRef<EventHandler<ulong>> _resultHandler;
|
||||
private bool _hostReserved;
|
||||
|
||||
public void Set(TableRef<ThreadedCounterEvent> evt, CounterType type, TableRef<EventHandler<ulong>> resultHandler, bool hostReserved)
|
||||
{
|
||||
_event = evt;
|
||||
_type = type;
|
||||
_resultHandler = resultHandler;
|
||||
_hostReserved = hostReserved;
|
||||
}
|
||||
|
||||
public static void Run(ref ReportCounterCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
ThreadedCounterEvent evt = command._event.Get(threaded);
|
||||
|
||||
evt.Create(renderer, command._type, command._resultHandler.Get(threaded), command._hostReserved);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct ResetCounterCommand : IGALCommand, IGALCommand<ResetCounterCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.ResetCounter;
|
||||
private CounterType _type;
|
||||
|
||||
public void Set(CounterType type)
|
||||
{
|
||||
_type = type;
|
||||
}
|
||||
|
||||
public static void Run(ref ResetCounterCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
renderer.ResetCounter(command._type);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
|
||||
{
|
||||
struct UpdateCountersCommand : IGALCommand, IGALCommand<UpdateCountersCommand>
|
||||
{
|
||||
public CommandType CommandType => CommandType.UpdateCounters;
|
||||
|
||||
public static void Run(ref UpdateCountersCommand command, ThreadedRenderer threaded, IRenderer renderer)
|
||||
{
|
||||
renderer.UpdateCounters();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user