mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
NVIDIA: low latency code decouple
This commit is contained in:
parent
fd8b2f255e
commit
65bff96db1
@ -179,28 +179,9 @@ void CEngineAPI::PumpMessages()
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CEngineAPI::MainLoop()
|
||||
void CEngineAPI::UpdateLowLatencyParameters()
|
||||
{
|
||||
// Main message pump
|
||||
while (true)
|
||||
{
|
||||
// Pump messages unless someone wants to quit
|
||||
if (g_pEngine->GetQuitting() != IEngine::QUIT_NOTQUITTING)
|
||||
{
|
||||
if (g_pEngine->GetQuitting() != IEngine::QUIT_TODESKTOP)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef DEDICATED
|
||||
if (GFX_IsLowLatencySDKEnabled())
|
||||
{
|
||||
if (GFX_HasPendingLowLatencyParameterUpdates())
|
||||
{
|
||||
const bool bUseLowLatencyMode = gfx_nvnUseLowLatency->GetBool();
|
||||
const bool bUseLowLatencyBoost = gfx_nvnUseLowLatencyBoost->GetBool();
|
||||
const bool bUseMarkersToOptimize = gfx_nvnUseMarkersToOptimize->GetBool();
|
||||
@ -223,11 +204,43 @@ bool CEngineAPI::MainLoop()
|
||||
|
||||
GFX_UpdateLowLatencyParameters(D3D11Device(), bUseLowLatencyMode,
|
||||
bUseLowLatencyBoost, bUseMarkersToOptimize, fpsMax);
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
void CEngineAPI::RunLowLatencyFrame()
|
||||
{
|
||||
#ifndef DEDICATED
|
||||
if (GFX_IsLowLatencySDKEnabled())
|
||||
{
|
||||
if (GFX_HasPendingLowLatencyParameterUpdates())
|
||||
{
|
||||
UpdateLowLatencyParameters();
|
||||
}
|
||||
|
||||
GFX_RunLowLatencyFrame(D3D11Device());
|
||||
}
|
||||
#endif // !DEDICATED
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CEngineAPI::MainLoop()
|
||||
{
|
||||
// Main message pump
|
||||
while (true)
|
||||
{
|
||||
// Pump messages unless someone wants to quit
|
||||
if (g_pEngine->GetQuitting() != IEngine::QUIT_NOTQUITTING)
|
||||
{
|
||||
if (g_pEngine->GetQuitting() != IEngine::QUIT_TODESKTOP)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifndef DEDICATED
|
||||
CEngineAPI::RunLowLatencyFrame();
|
||||
CEngineAPI::PumpMessages();
|
||||
#endif // !DEDICATED
|
||||
|
||||
|
@ -35,6 +35,9 @@ public:
|
||||
static void VSetStartupInfo(CEngineAPI* pEngineAPI, StartupInfo_t* pStartupInfo);
|
||||
|
||||
static void PumpMessages();
|
||||
static void RunLowLatencyFrame();
|
||||
static void UpdateLowLatencyParameters();
|
||||
|
||||
static bool MainLoop();
|
||||
//private:
|
||||
void* m_hEditorHWnd;
|
||||
|
Loading…
x
Reference in New Issue
Block a user