mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-09-22 13:25:35 +00:00
Fixed Infinity checks
This commit is contained in:
@@ -334,7 +334,7 @@ ffxReturnCode_t FSRFG_Dx12::DispatchCallback(ffxDispatchDescFrameGeneration* par
|
||||
const int fIndex = params->frameID % BUFFER_COUNT;
|
||||
|
||||
if (!Config::Instance()->FGSkipReset.value_or_default())
|
||||
params->reset = (_reset[fIndex] != 0);
|
||||
params->reset = (_reset[fIndex] != 0);
|
||||
else
|
||||
params->reset = 0;
|
||||
|
||||
|
||||
@@ -556,9 +556,9 @@ bool XeFG_Dx12::Dispatch()
|
||||
std::swap(_cameraNear[fIndex], _cameraFar[fIndex]);
|
||||
|
||||
if (_infiniteDepth && _cameraFar[fIndex] > _cameraNear[fIndex])
|
||||
_cameraFar[fIndex] = INFINITY;
|
||||
_cameraFar[fIndex] = std::numeric_limits<float>::infinity();
|
||||
else if (_infiniteDepth && _cameraNear[fIndex] > _cameraFar[fIndex])
|
||||
_cameraNear[fIndex] = INFINITY;
|
||||
_cameraNear[fIndex] = std::numeric_limits<float>::infinity();
|
||||
|
||||
// Cyberpunk seems to be sending LH so do the same
|
||||
// it also sends some extra data in usually empty spots but no idea what that is
|
||||
@@ -584,7 +584,7 @@ bool XeFG_Dx12::Dispatch()
|
||||
constData.motionVectorScaleY = _mvScaleY[fIndex];
|
||||
|
||||
if (!Config::Instance()->FGSkipReset.value_or_default())
|
||||
constData.resetHistory = _reset[fIndex];
|
||||
constData.resetHistory = _reset[fIndex];
|
||||
else
|
||||
constData.resetHistory = false;
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ class DLSSGMod
|
||||
|
||||
InParameters->Set("DLSSG.CameraFar", cameraFar);
|
||||
}
|
||||
else if (cameraFar == INFINITY)
|
||||
else if (std::isinf(cameraFar))
|
||||
{
|
||||
cameraFar = 100000.0f;
|
||||
InParameters->Set("DLSSG.CameraFar", cameraFar);
|
||||
@@ -499,7 +499,7 @@ class DLSSGMod
|
||||
|
||||
InParameters->Set("DLSSG.CameraFar", cameraFar);
|
||||
}
|
||||
else if (cameraFar == INFINITY)
|
||||
else if (std::isinf(cameraFar))
|
||||
{
|
||||
cameraFar = 10000;
|
||||
InParameters->Set("DLSSG.CameraFar", cameraFar);
|
||||
|
||||
@@ -4036,7 +4036,7 @@ bool MenuCommon::RenderMenu()
|
||||
}
|
||||
|
||||
// set initial value
|
||||
if (_limitFps == INFINITY)
|
||||
if (std::isinf(_limitFps))
|
||||
_limitFps = Config::Instance()->FramerateLimit.value_or_default();
|
||||
|
||||
ImGui::SliderFloat("FPS Limit", &_limitFps, 0, 200, "%.0f");
|
||||
|
||||
@@ -52,7 +52,7 @@ class MenuCommon
|
||||
inline static UINT64 _frameCount = 0;
|
||||
|
||||
// reflex
|
||||
inline static float _limitFps = INFINITY;
|
||||
inline static float _limitFps = std::numeric_limits<float>::infinity();
|
||||
|
||||
// fsr3x
|
||||
inline static int _fsr3xIndex = -1;
|
||||
|
||||
Reference in New Issue
Block a user