mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-25 05:54:57 +00:00
only apply vsync on changes
nvidia over bumblebee slows down on changes
This commit is contained in:
parent
485bd70df2
commit
6958822f19
1 changed files with 9 additions and 3 deletions
|
@ -136,6 +136,8 @@ static int s_LastMultisampleMode = 0;
|
||||||
|
|
||||||
static u32 s_blendMode;
|
static u32 s_blendMode;
|
||||||
|
|
||||||
|
static bool s_vsync;
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
static std::thread scrshotThread;
|
static std::thread scrshotThread;
|
||||||
#endif
|
#endif
|
||||||
|
@ -349,8 +351,8 @@ Renderer::Renderer()
|
||||||
s_backbuffer_height = (int)GLInterface->GetBackBufferHeight();
|
s_backbuffer_height = (int)GLInterface->GetBackBufferHeight();
|
||||||
|
|
||||||
// Handle VSync on/off
|
// Handle VSync on/off
|
||||||
int swapInterval = g_ActiveConfig.IsVSync() ? 1 : 0;
|
s_vsync = g_ActiveConfig.IsVSync();
|
||||||
GLInterface->SwapInterval(swapInterval);
|
GLInterface->SwapInterval(s_vsync);
|
||||||
|
|
||||||
// check the max texture width and height
|
// check the max texture width and height
|
||||||
GLint max_texture_size;
|
GLint max_texture_size;
|
||||||
|
@ -1341,7 +1343,11 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
|
||||||
|
|
||||||
GL_REPORT_ERRORD();
|
GL_REPORT_ERRORD();
|
||||||
|
|
||||||
GLInterface->SwapInterval(g_ActiveConfig.IsVSync() ? 1 : 0);
|
if(s_vsync != g_ActiveConfig.IsVSync())
|
||||||
|
{
|
||||||
|
s_vsync = g_ActiveConfig.IsVSync();
|
||||||
|
GLInterface->SwapInterval(s_vsync);
|
||||||
|
}
|
||||||
|
|
||||||
// Clean out old stuff from caches. It's not worth it to clean out the shader caches.
|
// Clean out old stuff from caches. It's not worth it to clean out the shader caches.
|
||||||
DLCache::ProgressiveCleanup();
|
DLCache::ProgressiveCleanup();
|
||||||
|
|
Loading…
Add table
Reference in a new issue