From aa7f0149bd2ff8f4cf50d1eb1fde587ec921421c Mon Sep 17 00:00:00 2001 From: Matthew Endsley Date: Tue, 30 Dec 2014 01:20:55 +0000 Subject: [PATCH] Resolve D3D11 render targets before switching. --- src/renderer_d3d11.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index c69424ca7..c208773d2 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1436,6 +1436,14 @@ namespace bgfx { namespace d3d11 void setFrameBuffer(FrameBufferHandle _fbh, bool _msaa = true) { + if (isValid(m_fbh) + && m_fbh.idx != _fbh.idx + && m_rtMsaa) + { + FrameBufferD3D11& frameBuffer = m_frameBuffers[m_fbh.idx]; + frameBuffer.resolve(); + } + BX_UNUSED(_msaa); if (!isValid(_fbh) ) { @@ -1455,14 +1463,6 @@ namespace bgfx { namespace d3d11 m_currentDepthStencil = frameBuffer.m_dsv; } - if (isValid(m_fbh) - && m_fbh.idx != _fbh.idx - && m_rtMsaa) - { - FrameBufferD3D11& frameBuffer = m_frameBuffers[m_fbh.idx]; - frameBuffer.resolve(); - } - m_fbh = _fbh; m_rtMsaa = _msaa; }