From 8aad1c78afc0924691527e049ac3574c988a6147 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sun, 14 May 2023 15:59:26 -0500 Subject: [PATCH] GS:MTL: Remove hdr copy pipeline No longer needed --- pcsx2/GS/Renderers/Metal/GSDeviceMTL.h | 1 - pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm | 16 +++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h index de16233f2b..456f057e8e 100644 --- a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h +++ b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.h @@ -254,7 +254,6 @@ public: MRCOwned> m_cas_pipeline[2]; MRCOwned> m_convert_pipeline[static_cast(ShaderConvert::Count)]; MRCOwned> m_present_pipeline[static_cast(PresentShader::Count)]; - MRCOwned> m_convert_pipeline_copy[2]; MRCOwned> m_convert_pipeline_copy_mask[1 << 4]; MRCOwned> m_merge_pipeline[4]; MRCOwned> m_interlace_pipeline[NUM_INTERLACE_SHADERS]; diff --git a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm index d61de163bb..12f04e032b 100644 --- a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm +++ b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm @@ -1075,7 +1075,6 @@ bool GSDeviceMTL::Create() NSString* name = [NSString stringWithCString:shaderName(conv) encoding:NSUTF8StringEncoding]; switch (conv) { - case ShaderConvert::COPY: case ShaderConvert::Count: case ShaderConvert::DATM_0: case ShaderConvert::DATM_1: @@ -1105,6 +1104,7 @@ bool GSDeviceMTL::Create() pdesc.colorAttachments[0].pixelFormat = MTLPixelFormatInvalid; pdesc.depthAttachmentPixelFormat = ConvertPixelFormat(GSTexture::Format::DepthStencil); break; + case ShaderConvert::COPY: case ShaderConvert::RGBA_TO_8I: // Yes really case ShaderConvert::TRANSPARENCY_FILTER: case ShaderConvert::FLOAT32_TO_RGBA8: @@ -1124,10 +1124,6 @@ bool GSDeviceMTL::Create() pdesc.colorAttachments[0].pixelFormat = layer_px_fmt; m_present_pipeline[i] = MakePipeline(pdesc, vs_convert, LoadShader(name), [NSString stringWithFormat:@"present_%s", shaderName(conv) + 3]); } - pdesc.colorAttachments[0].pixelFormat = ConvertPixelFormat(GSTexture::Format::Color); - m_convert_pipeline_copy[0] = MakePipeline(pdesc, vs_convert, ps_copy, @"copy_color"); - pdesc.colorAttachments[0].pixelFormat = ConvertPixelFormat(GSTexture::Format::HDRColor); - m_convert_pipeline_copy[1] = MakePipeline(pdesc, vs_convert, ps_copy, @"copy_hdr"); pdesc.colorAttachments[0].pixelFormat = MTLPixelFormatRGBA8Unorm; for (size_t i = 0; i < std::size(m_convert_pipeline_copy_mask); i++) @@ -1574,17 +1570,11 @@ void GSDeviceMTL::RenderCopy(GSTexture* sTex, id pipelin void GSDeviceMTL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture* dTex, const GSVector4& dRect, ShaderConvert shader, bool linear) { @autoreleasepool { - id pipeline; pxAssert(linear ? SupportsBilinear(shader) : SupportsNearest(shader)); - if (shader == ShaderConvert::COPY) - pipeline = m_convert_pipeline_copy[dTex->GetFormat() == GSTexture::Format::Color ? 0 : 1]; - else - pipeline = m_convert_pipeline[static_cast(shader)]; - - if (!pipeline) - [NSException raise:@"StretchRect Missing Pipeline" format:@"No pipeline for %d", static_cast(shader)]; + id pipeline = m_convert_pipeline[static_cast(shader)]; + pxAssertRel(pipeline, fmt::format("No pipeline for {}", shaderName(shader)).c_str()); DoStretchRect(sTex, sRect, dTex, dRect, pipeline, linear, LoadAction::DontCareIfFull, nullptr, 0); }}