瀏覽代碼

Resolve D3D11 render targets before switching.

Matthew Endsley 11 年之前
父節點
當前提交
aa7f0149bd
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. 8 8
      src/renderer_d3d11.cpp

+ 8 - 8
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;
 		}