|
@@ -1508,29 +1508,26 @@ namespace bgfx { namespace d3d12
|
|
|
|
|
|
|
|
HRESULT hr = S_OK;
|
|
HRESULT hr = S_OK;
|
|
|
uint32_t syncInterval = !!(m_resolution.reset & BGFX_RESET_VSYNC);
|
|
uint32_t syncInterval = !!(m_resolution.reset & BGFX_RESET_VSYNC);
|
|
|
- uint32_t flags = 0;
|
|
|
|
|
|
|
+ uint32_t presentFlags = 0;
|
|
|
if (syncInterval)
|
|
if (syncInterval)
|
|
|
{
|
|
{
|
|
|
- flags |= DXGI_PRESENT_RESTART;
|
|
|
|
|
|
|
+ presentFlags |= DXGI_PRESENT_RESTART;
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
|
|
+ else if (m_dxgi.tearingSupported() )
|
|
|
{
|
|
{
|
|
|
- if (m_dxgi.tearingSupported())
|
|
|
|
|
- {
|
|
|
|
|
- flags |= DXGI_PRESENT_ALLOW_TEARING;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ presentFlags |= DXGI_PRESENT_ALLOW_TEARING;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (uint32_t ii = 1, num = m_numWindows; ii < num && SUCCEEDED(hr); ++ii)
|
|
for (uint32_t ii = 1, num = m_numWindows; ii < num && SUCCEEDED(hr); ++ii)
|
|
|
{
|
|
{
|
|
|
FrameBufferD3D12& frameBuffer = m_frameBuffers[m_windows[ii].idx];
|
|
FrameBufferD3D12& frameBuffer = m_frameBuffers[m_windows[ii].idx];
|
|
|
- hr = frameBuffer.present(syncInterval, flags);
|
|
|
|
|
|
|
+ hr = frameBuffer.present(syncInterval, presentFlags);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr)
|
|
if (SUCCEEDED(hr)
|
|
|
&& NULL != m_swapChain)
|
|
&& NULL != m_swapChain)
|
|
|
{
|
|
{
|
|
|
- hr = m_swapChain->Present(syncInterval, flags);
|
|
|
|
|
|
|
+ hr = m_swapChain->Present(syncInterval, presentFlags);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int64_t now = bx::getHPCounter();
|
|
int64_t now = bx::getHPCounter();
|