diff options
Diffstat (limited to 'Ryujinx.Graphics.GAL/Multithreading')
10 files changed, 6 insertions, 118 deletions
diff --git a/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs b/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs index 67e8315b..442a9045 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs @@ -4,7 +4,6 @@ using Ryujinx.Graphics.GAL.Multithreading.Commands.CounterEvent; using Ryujinx.Graphics.GAL.Multithreading.Commands.Program; using Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer; using Ryujinx.Graphics.GAL.Multithreading.Commands.Sampler; -using Ryujinx.Graphics.GAL.Multithreading.Commands.Shader; using Ryujinx.Graphics.GAL.Multithreading.Commands.Texture; using Ryujinx.Graphics.GAL.Multithreading.Commands.Window; using System; @@ -53,8 +52,6 @@ namespace Ryujinx.Graphics.GAL.Multithreading { _lookup[(int)CommandType.Action] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => ActionCommand.Run(ref GetCommand<ActionCommand>(memory), threaded, renderer); - _lookup[(int)CommandType.CompileShader] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => - CompileShaderCommand.Run(ref GetCommand<CompileShaderCommand>(memory), threaded, renderer); _lookup[(int)CommandType.CreateBuffer] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => CreateBufferCommand.Run(ref GetCommand<CreateBufferCommand>(memory), threaded, renderer); _lookup[(int)CommandType.CreateProgram] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => @@ -98,9 +95,6 @@ namespace Ryujinx.Graphics.GAL.Multithreading _lookup[(int)CommandType.SamplerDispose] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => SamplerDisposeCommand.Run(ref GetCommand<SamplerDisposeCommand>(memory), threaded, renderer); - _lookup[(int)CommandType.ShaderDispose] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => - ShaderDisposeCommand.Run(ref GetCommand<ShaderDisposeCommand>(memory), threaded, renderer); - _lookup[(int)CommandType.TextureCopyTo] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => TextureCopyToCommand.Run(ref GetCommand<TextureCopyToCommand>(memory), threaded, renderer); _lookup[(int)CommandType.TextureCopyToScaled] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => diff --git a/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs b/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs index e0a03ce7..5c42abd1 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs @@ -3,7 +3,6 @@ enum CommandType : byte { Action, - CompileShader, CreateBuffer, CreateProgram, CreateSampler, @@ -29,8 +28,6 @@ SamplerDispose, - ShaderDispose, - TextureCopyTo, TextureCopyToScaled, TextureCopyToSlice, diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CompileShaderCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CompileShaderCommand.cs deleted file mode 100644 index 2bd9725d..00000000 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CompileShaderCommand.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Ryujinx.Graphics.GAL.Multithreading.Model; -using Ryujinx.Graphics.GAL.Multithreading.Resources; - -namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer -{ - struct CompileShaderCommand : IGALCommand - { - public CommandType CommandType => CommandType.CompileShader; - private TableRef<ThreadedShader> _shader; - - public void Set(TableRef<ThreadedShader> shader) - { - _shader = shader; - } - - public static void Run(ref CompileShaderCommand command, ThreadedRenderer threaded, IRenderer renderer) - { - ThreadedShader shader = command._shader.Get(threaded); - shader.EnsureCreated(); - } - } -} diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CreateBufferCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CreateBufferCommand.cs index 4d1cbb28..a96b3cef 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CreateBufferCommand.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CreateBufferCommand.cs @@ -1,7 +1,4 @@ -using Ryujinx.Graphics.GAL.Multithreading.Resources; -using Ryujinx.Graphics.Shader; - -namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer +namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer { struct CreateBufferCommand : IGALCommand { diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/PreFrameCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/PreFrameCommand.cs index 67cafd18..1048dc9e 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/PreFrameCommand.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/PreFrameCommand.cs @@ -1,6 +1,4 @@ -using System; - -namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer +namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer { struct PreFrameCommand : IGALCommand { diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/Shader/ShaderDisposeCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/Shader/ShaderDisposeCommand.cs deleted file mode 100644 index ebb2c927..00000000 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/Shader/ShaderDisposeCommand.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Ryujinx.Graphics.GAL.Multithreading.Model; -using Ryujinx.Graphics.GAL.Multithreading.Resources; - -namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Shader -{ - struct ShaderDisposeCommand : IGALCommand - { - public CommandType CommandType => CommandType.ShaderDispose; - private TableRef<ThreadedShader> _shader; - - public void Set(TableRef<ThreadedShader> shader) - { - _shader = shader; - } - - public static void Run(ref ShaderDisposeCommand command, ThreadedRenderer threaded, IRenderer renderer) - { - command._shader.Get(threaded).Base.Dispose(); - } - } -} diff --git a/Ryujinx.Graphics.GAL/Multithreading/Resources/Programs/SourceProgramRequest.cs b/Ryujinx.Graphics.GAL/Multithreading/Resources/Programs/SourceProgramRequest.cs index d808fe22..7c5f0363 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/Resources/Programs/SourceProgramRequest.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/Resources/Programs/SourceProgramRequest.cs @@ -6,10 +6,10 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Resources.Programs { public ThreadedProgram Threaded { get; set; } - private IShader[] _shaders; + private ShaderSource[] _shaders; private ShaderInfo _info; - public SourceProgramRequest(ThreadedProgram program, IShader[] shaders, ShaderInfo info) + public SourceProgramRequest(ThreadedProgram program, ShaderSource[] shaders, ShaderInfo info) { Threaded = program; @@ -19,14 +19,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Resources.Programs public IProgram Create(IRenderer renderer) { - IShader[] shaders = _shaders.Select(shader => - { - var threaded = (ThreadedShader)shader; - threaded?.EnsureCreated(); - return threaded?.Base; - }).ToArray(); - - return renderer.CreateProgram(shaders, _info); + return renderer.CreateProgram(_shaders, _info); } } } diff --git a/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedShader.cs b/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedShader.cs deleted file mode 100644 index dcbecf38..00000000 --- a/Ryujinx.Graphics.GAL/Multithreading/Resources/ThreadedShader.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Ryujinx.Graphics.GAL.Multithreading.Commands.Shader; -using Ryujinx.Graphics.GAL.Multithreading.Model; -using Ryujinx.Graphics.Shader; - -namespace Ryujinx.Graphics.GAL.Multithreading.Resources -{ - class ThreadedShader : IShader - { - private ThreadedRenderer _renderer; - private ShaderStage _stage; - private string _code; - - public IShader Base; - - public ThreadedShader(ThreadedRenderer renderer, ShaderStage stage, string code) - { - _renderer = renderer; - - _stage = stage; - _code = code; - } - - internal void EnsureCreated() - { - if (_code != null && Base == null) - { - Base = _renderer.BaseRenderer.CompileShader(_stage, _code); - _code = null; - } - } - - public void Dispose() - { - _renderer.New<ShaderDisposeCommand>().Set(new TableRef<ThreadedShader>(_renderer, this)); - _renderer.QueueCommand(); - } - } -} diff --git a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs index 6dc8ef38..b6acfaa8 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs @@ -1,7 +1,6 @@ using Ryujinx.Graphics.GAL.Multithreading.Commands; using Ryujinx.Graphics.GAL.Multithreading.Model; using Ryujinx.Graphics.GAL.Multithreading.Resources; -using Ryujinx.Graphics.Shader; using System; using System.Linq; diff --git a/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs b/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs index 5030fee6..63b668ba 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/ThreadedRenderer.cs @@ -250,15 +250,6 @@ namespace Ryujinx.Graphics.GAL.Multithreading } } - public IShader CompileShader(ShaderStage stage, string code) - { - var shader = new ThreadedShader(this, stage, code); - New<CompileShaderCommand>().Set(Ref(shader)); - QueueCommand(); - - return shader; - } - public BufferHandle CreateBuffer(int size) { BufferHandle handle = Buffers.CreateBufferHandle(); @@ -268,7 +259,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading return handle; } - public IProgram CreateProgram(IShader[] shaders, ShaderInfo info) + public IProgram CreateProgram(ShaderSource[] shaders, ShaderInfo info) { var program = new ThreadedProgram(this); SourceProgramRequest request = new SourceProgramRequest(program, shaders, info); |