mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 04:53:06 +01:00
Merge pull request #140 from mendsley/resolve
Resolve active render target in D3D9 before switch
This commit is contained in:
@@ -939,6 +939,14 @@ namespace bgfx
|
||||
|
||||
void setFrameBuffer(FrameBufferHandle _fbh, bool _msaa = true)
|
||||
{
|
||||
if (isValid(m_fbh)
|
||||
&& m_fbh.idx != _fbh.idx
|
||||
&& m_rtMsaa)
|
||||
{
|
||||
FrameBufferD3D9& frameBuffer = m_frameBuffers[m_fbh.idx];
|
||||
frameBuffer.resolve();
|
||||
}
|
||||
|
||||
if (!isValid(_fbh) )
|
||||
{
|
||||
DX_CHECK(m_device->SetRenderTarget(0, m_backBufferColor) );
|
||||
@@ -970,14 +978,6 @@ namespace bgfx
|
||||
DX_CHECK(m_device->SetDepthStencilSurface(NULL != depthStencil ? depthStencil : m_backBufferDepthStencil) );
|
||||
}
|
||||
|
||||
if (isValid(m_fbh)
|
||||
&& m_fbh.idx != _fbh.idx
|
||||
&& m_rtMsaa)
|
||||
{
|
||||
FrameBufferD3D9& frameBuffer = m_frameBuffers[m_fbh.idx];
|
||||
frameBuffer.resolve();
|
||||
}
|
||||
|
||||
m_fbh = _fbh;
|
||||
m_rtMsaa = _msaa;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user