mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 13:32:59 +01:00
Cleanup.
This commit is contained in:
@@ -788,7 +788,7 @@ namespace bgfx
|
||||
#endif // BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
|
||||
}
|
||||
|
||||
bool Dxgi::tearingSupported()
|
||||
bool Dxgi::tearingSupported() const
|
||||
{
|
||||
return m_tearingSupported;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace bgfx
|
||||
void trim();
|
||||
|
||||
///
|
||||
bool tearingSupported();
|
||||
bool tearingSupported() const;
|
||||
|
||||
///
|
||||
void* m_dxgiDll;
|
||||
|
||||
@@ -2288,10 +2288,13 @@ namespace bgfx { namespace d3d11
|
||||
&& m_needPresent)
|
||||
{
|
||||
uint32_t presentFlags = 0;
|
||||
if (!syncInterval && (m_dxgi.tearingSupported()))
|
||||
|
||||
if (!syncInterval
|
||||
&& m_dxgi.tearingSupported() )
|
||||
{
|
||||
presentFlags |= DXGI_PRESENT_ALLOW_TEARING;
|
||||
}
|
||||
|
||||
hr = m_swapChain->Present(syncInterval, presentFlags);
|
||||
|
||||
m_needPresent = false;
|
||||
|
||||
@@ -1508,29 +1508,26 @@ namespace bgfx { namespace d3d12
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
uint32_t syncInterval = !!(m_resolution.reset & BGFX_RESET_VSYNC);
|
||||
uint32_t flags = 0;
|
||||
uint32_t presentFlags = 0;
|
||||
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)
|
||||
{
|
||||
FrameBufferD3D12& frameBuffer = m_frameBuffers[m_windows[ii].idx];
|
||||
hr = frameBuffer.present(syncInterval, flags);
|
||||
hr = frameBuffer.present(syncInterval, presentFlags);
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr)
|
||||
&& NULL != m_swapChain)
|
||||
{
|
||||
hr = m_swapChain->Present(syncInterval, flags);
|
||||
hr = m_swapChain->Present(syncInterval, presentFlags);
|
||||
}
|
||||
|
||||
int64_t now = bx::getHPCounter();
|
||||
|
||||
Reference in New Issue
Block a user