Use swapchain's m_num only when attachment array has valid content

This commit is contained in:
Blaž Tomažič
2018-12-28 10:57:41 +01:00
parent a562f3f5a9
commit 2babc79d5c

View File

@@ -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);