SL-16043 Fix DisableVerticalSync, default DisableVerticalSync to off, remove broken frame limiter code (use vsync if you want to limit framerate).

meow-7.2.2
Dave Parks 2021-09-20 21:22:17 +00:00
parent f79890669d
commit 014dd037dd
4 changed files with 6 additions and 54 deletions

View File

@ -784,7 +784,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
LLCoordScreen windowPos(x,y);
LLCoordScreen windowSize(window_rect.right - window_rect.left,
window_rect.bottom - window_rect.top);
if (!switchContext(mFullscreen, windowSize, TRUE, &windowPos))
if (!switchContext(mFullscreen, windowSize, disable_vsync, &windowPos))
{
return;
}
@ -1764,6 +1764,7 @@ const S32 max_format = (S32)num_formats - 1;
else
{
LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL;
wglSwapIntervalEXT(1);
}
SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, (LONG_PTR)this);

View File

@ -812,17 +812,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>FramePerSecondLimit</key>
<map>
<key>Comment</key>
<string>Controls upper limit of frames per second</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>120</integer>
</map>
<key>BackgroundYieldTime</key>
<map>
<key>Comment</key>
@ -3366,13 +3355,13 @@
<key>DisableVerticalSync</key>
<map>
<key>Comment</key>
<string>Update frames as fast as possible (FALSE = update frames between display scans)</string>
<string>Update frames as fast as possible (FALSE = update frames between display scans). Requires restart.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
<integer>0</integer>
</map>
<key>EnableGroupChatPopups</key>
<map>

View File

@ -694,8 +694,7 @@ LLAppViewer::LLAppViewer()
mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)),
mFastTimerLogThread(NULL),
mSettingsLocationList(NULL),
mIsFirstRun(false),
mMinMicroSecPerFrame(0.f)
mIsFirstRun(false)
{
if(NULL != sInstance)
{
@ -1326,10 +1325,6 @@ bool LLAppViewer::init()
joystick = LLViewerJoystick::getInstance();
joystick->setNeedsReset(true);
/*----------------------------------------------------------------------*/
gSavedSettings.getControl("FramePerSecondLimit")->getSignal()->connect(boost::bind(&LLAppViewer::onChangeFrameLimit, this, _2));
onChangeFrameLimit(gSavedSettings.getLLSD("FramePerSecondLimit"));
// Load User's bindings
loadKeyBindings();
@ -1518,21 +1513,6 @@ bool LLAppViewer::doFrame()
display();
static U64 last_call = 0;
if (!gTeleportDisplay)
{
// Frame/draw throttling, controlled by FramePerSecondLimit
U64 elapsed_time = LLTimer::getTotalTime() - last_call;
if (elapsed_time < mMinMicroSecPerFrame)
{
LL_RECORD_BLOCK_TIME(FTM_SLEEP);
// llclamp for when time function gets funky
U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6);
micro_sleep(sleep_time, 0);
}
}
last_call = LLTimer::getTotalTime();
pingMainloopTimeout("Main:Snapshot");
LLFloaterSnapshot::update(); // take snapshots
LLFloaterOutfitSnapshot::update();
@ -5613,19 +5593,6 @@ void LLAppViewer::disconnectViewer()
LLUrlEntryParcel::setDisconnected(gDisconnected);
}
bool LLAppViewer::onChangeFrameLimit(LLSD const & evt)
{
if (evt.asInteger() > 0)
{
mMinMicroSecPerFrame = (U64)(1000000.0f / F32(evt.asInteger()));
}
else
{
mMinMicroSecPerFrame = 0;
}
return false;
}
void LLAppViewer::forceErrorLLError()
{
LL_ERRS() << "This is a deliberate llerror" << LL_ENDL;

View File

@ -262,8 +262,6 @@ private:
void sendLogoutRequest();
void disconnectViewer();
bool onChangeFrameLimit(LLSD const & evt);
// *FIX: the app viewer class should be some sort of singleton, no?
// Perhaps its child class is the singleton and this should be an abstract base.
static LLAppViewer* sInstance;
@ -319,10 +317,7 @@ private:
// llcorehttp library init/shutdown helper
LLAppCoreHttp mAppCoreHttp;
bool mIsFirstRun;
U64 mMinMicroSecPerFrame; // frame throttling
bool mIsFirstRun;
};
// consts from viewer.h