From 98c611e40400caf24bd2cc71874f12dddf918fa2 Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Mon, 6 Mar 2023 00:14:18 -0600 Subject: [PATCH] GS:MTL: Don't start render passes with no targets --- pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm index f9161ea481..66de891962 100644 --- a/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm +++ b/pcsx2/GS/Renderers/Metal/GSDeviceMTL.mm @@ -1710,6 +1710,15 @@ void GSDeviceMTL::RenderHW(GSHWDrawConfig& config) config.ds = nullptr; if (!config.ds && m_current_render.color_target == rt && stencil == m_current_render.stencil_target && m_current_render.depth_target != config.tex) config.ds = m_current_render.depth_target; + if (!rt && !config.ds) + { + // If we were rendering depth-only and depth gets cleared by the above check, that turns into rendering nothing, which should be a no-op + pxAssertDev(0, "RenderHW was given a completely useless draw call!"); + [m_current_render.encoder insertDebugSignpost:@"Skipped no-color no-depth draw"]; + if (primid_tex) + Recycle(primid_tex); + return; + } BeginRenderPass(@"RenderHW", rt, MTLLoadActionLoad, config.ds, MTLLoadActionLoad, stencil, MTLLoadActionLoad); id mtlenc = m_current_render.encoder;