diff --git a/src/modules/graphics/metal/Graphics.mm b/src/modules/graphics/metal/Graphics.mm index 451c319c0..1e3fa2a89 100644 --- a/src/modules/graphics/metal/Graphics.mm +++ b/src/modules/graphics/metal/Graphics.mm @@ -696,7 +696,10 @@ id Graphics::useRenderEncoder() auto &key = lastRenderPipelineKey; key.colorRenderTargetFormats = isGammaCorrect() ? PIXELFORMAT_BGRA8_sRGB : PIXELFORMAT_BGRA8_UNORM; - key.depthStencilFormat = backbufferDepthStencil->getPixelFormat(); + if (backbufferDepthStencil.get()) + key.depthStencilFormat = backbufferDepthStencil->getPixelFormat(); + else + key.depthStencilFormat = PIXELFORMAT_UNKNOWN; key.msaa = backbufferMSAA ? (uint8) backbufferMSAA->getMSAA() : 1; }