mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-09-23 05:46:27 +00:00
Merge branch 'v0.9' of https://github.com/optiscaler/OptiScaler into v0.9
This commit is contained in:
@@ -484,6 +484,8 @@ bool Sl_Inputs_Dx12::dispatchFG()
|
||||
|
||||
fgOutput->SetReset(slConstsRef.reset == sl::Boolean::eTrue);
|
||||
|
||||
fgOutput->SetFrameTimeDelta(State::Instance().lastFrameTime);
|
||||
|
||||
fgOutput->SetInterpolationRect(interpolationWidth, interpolationHeight);
|
||||
interpolationWidth = 0;
|
||||
interpolationHeight = 0;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <nvsdk_ngx_defs.h>
|
||||
|
||||
#include <unordered_set>
|
||||
#include <Util.h>
|
||||
|
||||
#define DLSS_MOD_ID_OFFSET 1000000
|
||||
|
||||
|
||||
@@ -5,32 +5,12 @@
|
||||
|
||||
double FSR2Feature::GetDeltaTime()
|
||||
{
|
||||
double currentTime = MillisecondsNow();
|
||||
double currentTime = Util::MillisecondsNow();
|
||||
double deltaTime = (currentTime - _lastFrameTime);
|
||||
_lastFrameTime = currentTime;
|
||||
return deltaTime;
|
||||
}
|
||||
|
||||
double FSR2Feature::MillisecondsNow()
|
||||
{
|
||||
static LARGE_INTEGER s_frequency;
|
||||
static BOOL s_use_qpc = QueryPerformanceFrequency(&s_frequency);
|
||||
double milliseconds = 0;
|
||||
|
||||
if (s_use_qpc)
|
||||
{
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
milliseconds = double(1000.0 * now.QuadPart) / s_frequency.QuadPart;
|
||||
}
|
||||
else
|
||||
{
|
||||
milliseconds = double(GetTickCount64());
|
||||
}
|
||||
|
||||
return milliseconds;
|
||||
}
|
||||
|
||||
FSR2Feature::~FSR2Feature()
|
||||
{
|
||||
if (!IsInited())
|
||||
|
||||
@@ -70,7 +70,6 @@ class FSR2Feature : public virtual IFeature
|
||||
|
||||
virtual bool InitFSR2(const NVSDK_NGX_Parameter* InParameters) = 0;
|
||||
|
||||
double MillisecondsNow();
|
||||
double GetDeltaTime();
|
||||
|
||||
public:
|
||||
@@ -81,7 +80,7 @@ class FSR2Feature : public virtual IFeature
|
||||
{
|
||||
_initParameters = SetInitParameters(InParameters);
|
||||
_moduleLoaded = true;
|
||||
_lastFrameTime = MillisecondsNow();
|
||||
_lastFrameTime = Util::MillisecondsNow();
|
||||
}
|
||||
|
||||
~FSR2Feature();
|
||||
|
||||
@@ -4,32 +4,12 @@
|
||||
|
||||
double FSR2Feature212::GetDeltaTime()
|
||||
{
|
||||
double currentTime = MillisecondsNow();
|
||||
double currentTime = Util::MillisecondsNow();
|
||||
double deltaTime = (currentTime - _lastFrameTime);
|
||||
_lastFrameTime = currentTime;
|
||||
return deltaTime;
|
||||
}
|
||||
|
||||
double FSR2Feature212::MillisecondsNow()
|
||||
{
|
||||
static LARGE_INTEGER s_frequency;
|
||||
static BOOL s_use_qpc = QueryPerformanceFrequency(&s_frequency);
|
||||
double milliseconds = 0;
|
||||
|
||||
if (s_use_qpc)
|
||||
{
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
milliseconds = double(1000.0 * now.QuadPart) / s_frequency.QuadPart;
|
||||
}
|
||||
else
|
||||
{
|
||||
milliseconds = double(GetTickCount64());
|
||||
}
|
||||
|
||||
return milliseconds;
|
||||
}
|
||||
|
||||
FSR2Feature212::~FSR2Feature212()
|
||||
{
|
||||
if (!IsInited())
|
||||
|
||||
@@ -58,7 +58,6 @@ class FSR2Feature212 : public virtual IFeature
|
||||
|
||||
virtual bool InitFSR2(const NVSDK_NGX_Parameter* InParameters) = 0;
|
||||
|
||||
double MillisecondsNow();
|
||||
double GetDeltaTime();
|
||||
|
||||
public:
|
||||
@@ -69,7 +68,7 @@ class FSR2Feature212 : public virtual IFeature
|
||||
{
|
||||
_initParameters = SetInitParameters(InParameters);
|
||||
_moduleLoaded = true;
|
||||
_lastFrameTime = MillisecondsNow();
|
||||
_lastFrameTime = Util::MillisecondsNow();
|
||||
}
|
||||
|
||||
~FSR2Feature212();
|
||||
|
||||
@@ -4,30 +4,17 @@
|
||||
|
||||
double FSR31Feature::GetDeltaTime()
|
||||
{
|
||||
double currentTime = MillisecondsNow();
|
||||
double currentTime = Util::MillisecondsNow();
|
||||
double deltaTime = (currentTime - _lastFrameTime);
|
||||
_lastFrameTime = currentTime;
|
||||
return deltaTime;
|
||||
}
|
||||
|
||||
double FSR31Feature::MillisecondsNow()
|
||||
FSR31Feature::FSR31Feature(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters)
|
||||
: IFeature(InHandleId, InParameters)
|
||||
{
|
||||
static LARGE_INTEGER s_frequency;
|
||||
static BOOL s_use_qpc = QueryPerformanceFrequency(&s_frequency);
|
||||
double milliseconds = 0;
|
||||
|
||||
if (s_use_qpc)
|
||||
{
|
||||
LARGE_INTEGER now;
|
||||
QueryPerformanceCounter(&now);
|
||||
milliseconds = double(1000.0 * now.QuadPart) / s_frequency.QuadPart;
|
||||
}
|
||||
else
|
||||
{
|
||||
milliseconds = double(GetTickCount64());
|
||||
}
|
||||
|
||||
return milliseconds;
|
||||
_initParameters = SetInitParameters(InParameters);
|
||||
_lastFrameTime = Util::MillisecondsNow();
|
||||
}
|
||||
|
||||
FSR31Feature::~FSR31Feature()
|
||||
|
||||
@@ -26,7 +26,6 @@ class FSR31Feature : public virtual IFeature
|
||||
|
||||
virtual bool InitFSR3(const NVSDK_NGX_Parameter* InParameters) = 0;
|
||||
|
||||
double MillisecondsNow();
|
||||
double GetDeltaTime();
|
||||
|
||||
static inline void parse_version(const char* version_str)
|
||||
@@ -99,11 +98,7 @@ class FSR31Feature : public virtual IFeature
|
||||
feature_version Version() final { return _version; }
|
||||
std::string Name() const { return _name.c_str(); }
|
||||
|
||||
FSR31Feature(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters) : IFeature(InHandleId, InParameters)
|
||||
{
|
||||
_initParameters = SetInitParameters(InParameters);
|
||||
_lastFrameTime = MillisecondsNow();
|
||||
}
|
||||
FSR31Feature(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters);
|
||||
|
||||
~FSR31Feature();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user