r5sdk/r5dev/engine/client/cdll_engine_int.cpp
Kawe Mazidjatari ea6c15df4c Initial implementation of NVIDIA Reflex Low Latency timing
Propagated latency markers in an attempt to further reduce input latency. Code is pending rigorous testing on several systems, including systems powered by an AMD GPU to make sure we are not impacting performance on systems that does NOT support NVIDIA Reflex.
2023-09-12 11:06:16 +02:00

62 lines
2.1 KiB
C++

//=============================================================================
//
//
//=============================================================================
#include "core/stdafx.h"
/*****************************************************************************/
#include "tier1/cvar.h"
#include "tier0/commandline.h"
#include "engine/net_chan.h"
#include "engine/client/cl_rcon.h"
#include "networksystem/bansystem.h"
#include "vpc/keyvalues.h"
#include "windows/id3dx.h"
#include "geforce/reflex.h"
#include "vengineclient_impl.h"
#include "cdll_engine_int.h"
/*****************************************************************************/
#ifndef DEDICATED
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHLClient::FrameStageNotify(CHLClient* pHLClient, ClientFrameStage_t frameStage)
{
// Must be performed before the call, before scene starts rendering.
if (frameStage == ClientFrameStage_t::FRAME_RENDER_START)
GFX_SetLatencyMarker(D3D11Device(), RENDERSUBMIT_START);
CHLClient_FrameStageNotify(pHLClient, frameStage);
// Must be performed after the call, after the scene has been rendered.
if (frameStage == ClientFrameStage_t::FRAME_RENDER_END)
GFX_SetLatencyMarker(D3D11Device(), RENDERSUBMIT_END);
}
//-----------------------------------------------------------------------------
// Purpose: Get g_pClientClassHead Pointer for all ClientClasses.
// Input :
// Output : ClientClass*
//-----------------------------------------------------------------------------
ClientClass* CHLClient::GetAllClasses()
{
return CHLClient_GetAllClasses();
}
#endif // !DEDICATED
///////////////////////////////////////////////////////////////////////////////
void VDll_Engine_Int::Attach() const
{
#ifndef DEDICATED
DetourAttach((LPVOID*)&CHLClient_FrameStageNotify, &CHLClient::FrameStageNotify);
#endif // !DEDICATED
}
void VDll_Engine_Int::Detach() const
{
#ifndef DEDICATED
DetourDetach((LPVOID*)&CHLClient_FrameStageNotify, &CHLClient::FrameStageNotify);
#endif // !DEDICATED
}