mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: don't run NVIDIA Reflex if -gfx_disableLowLatency was specified
This command line argument should fully disable NVIDIA Reflex, AMD Anti-Lag 2 and PCL statistics.
This commit is contained in:
parent
0eb0d73ae1
commit
10efa56c58
@ -234,7 +234,7 @@ void CEngineAPI::UpdateLowLatencyParameters()
|
||||
void CEngineAPI::RunLowLatencyFrame()
|
||||
{
|
||||
#ifndef DEDICATED
|
||||
if (GeForce_IsLowLatencySDKEnabled())
|
||||
if (GeForce_IsLowLatencySDKAvailable())
|
||||
{
|
||||
if (GeForce_HasPendingLowLatencyParameterUpdates())
|
||||
{
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
static bool s_LowLatencySDKEnabled = false;
|
||||
|
||||
static bool s_LowLatencyAvailable = false;
|
||||
|
||||
// If false, the system will call 'NvAPI_D3D_SetSleepMode' to update the parameters.
|
||||
static bool s_ReflexModeInfoUpToDate = false;
|
||||
|
||||
@ -31,9 +33,9 @@ void GeForce_EnableLowLatencySDK(const bool enable)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: whether we should run the low latency SDK
|
||||
//-----------------------------------------------------------------------------
|
||||
bool GeForce_IsLowLatencySDKEnabled(void)
|
||||
bool GeForce_IsLowLatencySDKAvailable(void)
|
||||
{
|
||||
if (!s_LowLatencySDKEnabled)
|
||||
if (!s_LowLatencySDKEnabled || !s_LowLatencyAvailable)
|
||||
return false;
|
||||
|
||||
const MaterialAdapterInfo_t& adapterInfo = g_pMaterialAdapterMgr->GetAdapterInfo();
|
||||
@ -42,6 +44,23 @@ bool GeForce_IsLowLatencySDKEnabled(void)
|
||||
return adapterInfo.m_VendorID == NVIDIA_VENDOR_ID;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: initialize the low latency SDK
|
||||
//-----------------------------------------------------------------------------
|
||||
bool GeForce_InitLowLatencySDK(void)
|
||||
{
|
||||
s_LowLatencyAvailable = true;
|
||||
return s_LowLatencyAvailable;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: shutdown the low latency SDK
|
||||
//-----------------------------------------------------------------------------
|
||||
void GeForce_ShutdownLowLatencySDK(void)
|
||||
{
|
||||
s_LowLatencyAvailable = false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: mark the parameters as out-of-date; force update next frame
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -126,7 +145,7 @@ void GeForce_SetLatencyMarker(IUnknown* const device,
|
||||
{
|
||||
Assert(device);
|
||||
|
||||
if (GeForce_ParameterUpdateWasSuccessful() && GeForce_IsLowLatencySDKEnabled())
|
||||
if (GeForce_ParameterUpdateWasSuccessful() && GeForce_IsLowLatencySDKAvailable())
|
||||
{
|
||||
NV_LATENCY_MARKER_PARAMS params = {};
|
||||
params.version = NV_LATENCY_MARKER_PARAMS_VER1;
|
||||
|
@ -4,7 +4,10 @@
|
||||
extern bool g_PCLStatsAvailable;
|
||||
|
||||
void GeForce_EnableLowLatencySDK(const bool enable);
|
||||
bool GeForce_IsLowLatencySDKEnabled(void);
|
||||
bool GeForce_IsLowLatencySDKAvailable(void);
|
||||
|
||||
bool GeForce_InitLowLatencySDK(void);
|
||||
void GeForce_ShutdownLowLatencySDK(void);
|
||||
|
||||
void GeForce_MarkLowLatencyParametersOutOfDate(void);
|
||||
bool GeForce_HasPendingLowLatencyParameterUpdates(void);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "rtech/pak/pakstate.h"
|
||||
#include "engine/cmodel_bsp.h"
|
||||
#include "engine/sys_engine.h"
|
||||
#include "engine/sys_dll2.h"
|
||||
#include "geforce/reflex.h"
|
||||
#include "radeon/antilag.h"
|
||||
#ifndef MATERIALSYSTEM_NODX
|
||||
@ -61,9 +62,10 @@ InitReturnVal_t CMaterialSystem::Init(CMaterialSystem* thisptr)
|
||||
|
||||
if (s_useLowLatency)
|
||||
{
|
||||
GeForce_InitLowLatencySDK();
|
||||
Radeon_InitLowLatencySDK();
|
||||
PCLSTATS_INIT(0);
|
||||
|
||||
PCLSTATS_INIT(0);
|
||||
g_PCLStatsAvailable = true;
|
||||
}
|
||||
|
||||
@ -83,6 +85,7 @@ int CMaterialSystem::Shutdown(CMaterialSystem* thisptr)
|
||||
PCLSTATS_SHUTDOWN();
|
||||
|
||||
Radeon_ShutdownLowLatencySDK();
|
||||
GeForce_ShutdownLowLatencySDK();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -28,6 +28,8 @@ void Radeon_EnableLowLatencySDK(const bool enable)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Radeon_IsLowLatencySDKAvailable(void)
|
||||
{
|
||||
// NOTE: don't check on s_LowLatencySDKEnabled here as this needs to be
|
||||
// provided to the driver itself.
|
||||
if (!s_LowLatencyAvailable)
|
||||
return false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user