From 2babc79d5cdcd2d97ef2dc7453dd2945580a56af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Toma=C5=BEi=C4=8D?= Date: Fri, 28 Dec 2018 10:57:41 +0100 Subject: [PATCH] Use swapchain's m_num only when attachment array has valid content --- src/renderer_mtl.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 453b6fb59..a99d84168 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -1465,7 +1465,7 @@ namespace bgfx { namespace mtl uint32_t numMrt = 1; FrameBufferHandle fbh = m_fbh; - if (isValid(fbh) ) + if (isValid(fbh) && m_frameBuffers[fbh.idx].m_swapChain == NULL) { const FrameBufferMtl& fb = m_frameBuffers[fbh.idx]; numMrt = bx::uint32_max(1, fb.m_num);