mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
NVIDIA: only run and shutdown PCL stats if it has been initialized
This commit is contained in:
parent
7d7c31d4a0
commit
ebd89d934f
@ -16,6 +16,9 @@ static bool s_ReflexModeInfoUpToDate = false;
|
||||
// If not, the Low Latency SDK will not run.
|
||||
static NvAPI_Status s_ReflexModeUpdateStatus = NvAPI_Status::NVAPI_OK;
|
||||
|
||||
// True if the PCL stats system was initialized.
|
||||
bool g_PCLStatsAvailable = false;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: enable/disable low latency SDK
|
||||
// Input : enable -
|
||||
@ -133,6 +136,9 @@ void GeForce_SetLatencyMarker(IUnknown* const device,
|
||||
NvAPI_D3D_SetLatencyMarker(device, ¶ms);
|
||||
}
|
||||
|
||||
// PCLStats runs separately and is supported on non-NVIDIA hardware.
|
||||
PCLSTATS_MARKER(markerType, frameID);
|
||||
if (g_PCLStatsAvailable)
|
||||
{
|
||||
// PCLStats runs separately and is supported on non-NVIDIA hardware.
|
||||
PCLSTATS_MARKER(markerType, frameID);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef GFSDK_REFLEX_H
|
||||
#define GFSDK_REFLEX_H
|
||||
|
||||
extern bool g_PCLStatsAvailable;
|
||||
|
||||
void GeForce_EnableLowLatencySDK(const bool enable);
|
||||
bool GeForce_IsLowLatencySDKEnabled(void);
|
||||
|
||||
|
@ -63,6 +63,8 @@ InitReturnVal_t CMaterialSystem::Init(CMaterialSystem* thisptr)
|
||||
{
|
||||
Radeon_InitLowLatencySDK();
|
||||
PCLSTATS_INIT(0);
|
||||
|
||||
g_PCLStatsAvailable = true;
|
||||
}
|
||||
|
||||
return CMaterialSystem__Init(thisptr);
|
||||
@ -77,7 +79,9 @@ int CMaterialSystem::Shutdown(CMaterialSystem* thisptr)
|
||||
#ifndef MATERIALSYSTEM_NODX
|
||||
if (s_useLowLatency)
|
||||
{
|
||||
PCLSTATS_SHUTDOWN();
|
||||
if (g_PCLStatsAvailable)
|
||||
PCLSTATS_SHUTDOWN();
|
||||
|
||||
Radeon_ShutdownLowLatencySDK();
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user