Remove use of reflection on GAL multithreading (#4287)

* Introduce new IGALCommand<T> interface and use it

* Remove use of reflection on GAL multithreading

* Unmanaged constraint
This commit is contained in:
gdkchan 2023-01-21 21:07:43 -03:00 committed by GitHub
parent 7b7f62c776
commit 7fea26e97e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 192 additions and 281 deletions

View file

@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct ActionCommand : IGALCommand
struct ActionCommand : IGALCommand, IGALCommand<ActionCommand>
{
public CommandType CommandType => CommandType.Action;
private TableRef<Action> _action;

View file

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct CreateBufferCommand : IGALCommand
struct CreateBufferCommand : IGALCommand, IGALCommand<CreateBufferCommand>
{
public CommandType CommandType => CommandType.CreateBuffer;
private BufferHandle _threadedHandle;

View file

@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources.Programs;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct CreateProgramCommand : IGALCommand
struct CreateProgramCommand : IGALCommand, IGALCommand<CreateProgramCommand>
{
public CommandType CommandType => CommandType.CreateProgram;
private TableRef<IProgramRequest> _request;

View file

@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct CreateSamplerCommand : IGALCommand
struct CreateSamplerCommand : IGALCommand, IGALCommand<CreateSamplerCommand>
{
public CommandType CommandType => CommandType.CreateSampler;
private TableRef<ThreadedSampler> _sampler;

View file

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct CreateSyncCommand : IGALCommand
struct CreateSyncCommand : IGALCommand, IGALCommand<CreateSyncCommand>
{
public CommandType CommandType => CommandType.CreateSync;
private ulong _id;

View file

@ -3,7 +3,7 @@ using Ryujinx.Graphics.GAL.Multithreading.Resources;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct CreateTextureCommand : IGALCommand
struct CreateTextureCommand : IGALCommand, IGALCommand<CreateTextureCommand>
{
public CommandType CommandType => CommandType.CreateTexture;
private TableRef<ThreadedTexture> _texture;

View file

@ -2,7 +2,7 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct GetCapabilitiesCommand : IGALCommand
struct GetCapabilitiesCommand : IGALCommand, IGALCommand<GetCapabilitiesCommand>
{
public CommandType CommandType => CommandType.GetCapabilities;
private TableRef<ResultBox<Capabilities>> _result;

View file

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct PreFrameCommand : IGALCommand
struct PreFrameCommand : IGALCommand, IGALCommand<PreFrameCommand>
{
public CommandType CommandType => CommandType.PreFrame;

View file

@ -4,7 +4,7 @@ using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct ReportCounterCommand : IGALCommand
struct ReportCounterCommand : IGALCommand, IGALCommand<ReportCounterCommand>
{
public CommandType CommandType => CommandType.ReportCounter;
private TableRef<ThreadedCounterEvent> _event;

View file

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct ResetCounterCommand : IGALCommand
struct ResetCounterCommand : IGALCommand, IGALCommand<ResetCounterCommand>
{
public CommandType CommandType => CommandType.ResetCounter;
private CounterType _type;

View file

@ -1,6 +1,6 @@
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
struct UpdateCountersCommand : IGALCommand
struct UpdateCountersCommand : IGALCommand, IGALCommand<UpdateCountersCommand>
{
public CommandType CommandType => CommandType.UpdateCounters;