From a968ec71fd3e1c8a0b16222d7ac1683416a92e80 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 13 Aug 2024 23:18:57 +0100 Subject: [PATCH] Remove RenderPipelineDescriptorResult --- .../State/PipelineState.cs | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/Ryujinx.Graphics.Metal/State/PipelineState.cs b/src/Ryujinx.Graphics.Metal/State/PipelineState.cs index 85e6907bd..9f88f3061 100644 --- a/src/Ryujinx.Graphics.Metal/State/PipelineState.cs +++ b/src/Ryujinx.Graphics.Metal/State/PipelineState.cs @@ -103,24 +103,6 @@ namespace Ryujinx.Graphics.Metal // Advanced blend not supported - private struct RenderPipelineDescriptorResult : IDisposable - { - public MTLRenderPipelineDescriptor Pipeline; - private MTLVertexDescriptor _vertex; - - public RenderPipelineDescriptorResult(MTLRenderPipelineDescriptor pipeline, MTLVertexDescriptor vertex) - { - Pipeline = pipeline; - _vertex = vertex; - } - - public void Dispose() - { - Pipeline.Dispose(); - _vertex.Dispose(); - } - } - private readonly void BuildColorAttachment(MTLRenderPipelineColorAttachmentDescriptor descriptor, ColorBlendStateUid blendState) { descriptor.PixelFormat = blendState.PixelFormat; @@ -162,7 +144,7 @@ namespace Ryujinx.Graphics.Metal return vertexDescriptor; } - private RenderPipelineDescriptorResult CreateRenderDescriptor(Program program) + private MTLRenderPipelineDescriptor CreateRenderDescriptor(Program program) { var renderPipelineDescriptor = new MTLRenderPipelineDescriptor(); @@ -223,7 +205,7 @@ namespace Ryujinx.Graphics.Metal renderPipelineDescriptor.FragmentFunction = program.FragmentFunction; } - return new RenderPipelineDescriptorResult(renderPipelineDescriptor, vertexDescriptor); + return renderPipelineDescriptor; } public MTLRenderPipelineState CreateRenderPipeline(MTLDevice device, Program program) @@ -233,10 +215,10 @@ namespace Ryujinx.Graphics.Metal return pipelineState; } - using RenderPipelineDescriptorResult descriptors = CreateRenderDescriptor(program); + using var descriptor = CreateRenderDescriptor(program); var error = new NSError(IntPtr.Zero); - pipelineState = device.NewRenderPipelineState(descriptors.Pipeline, ref error); + pipelineState = device.NewRenderPipelineState(descriptor, ref error); if (error != IntPtr.Zero) { Logger.Error?.PrintMsg(LogClass.Gpu, $"Failed to create Render Pipeline State: {StringHelper.String(error.LocalizedDescription)}");