mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-05-04 00:31:35 +00:00
Added last generated frame id and renamed some methods
This commit is contained in:
@@ -66,4 +66,6 @@ void IFGFeature::UpdateTarget()
|
||||
|
||||
UINT64 IFGFeature::FrameCount() { return _frameCount; }
|
||||
|
||||
UINT64 IFGFeature::LastDispatchedFrame() { return _lastDispatchedFrame; }
|
||||
|
||||
UINT64 IFGFeature::TargetFrame() { return _targetFrame; }
|
||||
|
||||
@@ -20,6 +20,7 @@ class IFGFeature
|
||||
UINT _reset = 0;
|
||||
|
||||
UINT64 _frameCount = 0;
|
||||
UINT64 _lastDispatchedFrame = 0;
|
||||
UINT64 _lastUpscaledFrameId = 0;
|
||||
|
||||
bool _isActive = false;
|
||||
@@ -39,7 +40,7 @@ class IFGFeature
|
||||
virtual void UpscaleEnd() = 0;
|
||||
virtual void Present() = 0;
|
||||
|
||||
virtual void SetVelocityAndDepthReady() = 0;
|
||||
virtual void SetUpscaleInputsReady() = 0;
|
||||
virtual void SetHudlessReady() = 0;
|
||||
virtual void SetHudlessDispatchReady() = 0;
|
||||
|
||||
@@ -64,6 +65,7 @@ class IFGFeature
|
||||
void UpdateTarget();
|
||||
|
||||
UINT64 FrameCount();
|
||||
UINT64 LastDispatchedFrame();
|
||||
UINT64 TargetFrame();
|
||||
|
||||
IFGFeature() = default;
|
||||
|
||||
@@ -90,7 +90,6 @@ void IFGFeature_Dx12::SetVelocity(ID3D12GraphicsCommandList* cmdList, ID3D12Reso
|
||||
D3D12_RESOURCE_STATES state)
|
||||
{
|
||||
auto index = GetIndex();
|
||||
LOG_TRACE("Setting velocity, index: {}", index);
|
||||
|
||||
if (cmdList == nullptr)
|
||||
return;
|
||||
@@ -121,7 +120,10 @@ void IFGFeature_Dx12::SetVelocity(ID3D12GraphicsCommandList* cmdList, ID3D12Reso
|
||||
D3D12_RESOURCE_STATE_COPY_DEST);
|
||||
|
||||
if (result)
|
||||
{
|
||||
LOG_TRACE("Setting velocity from flip, index: {}", index);
|
||||
_paramVelocity[index] = _paramVelocityCopy[index];
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -130,6 +132,7 @@ void IFGFeature_Dx12::SetVelocity(ID3D12GraphicsCommandList* cmdList, ID3D12Reso
|
||||
if (Config::Instance()->FGMakeMVCopy.value_or_default() &&
|
||||
CopyResource(cmdList, velocity, &_paramVelocityCopy[index], state))
|
||||
{
|
||||
LOG_TRACE("Setting velocity, index: {}", index);
|
||||
_paramVelocity[index] = _paramVelocityCopy[index];
|
||||
return;
|
||||
}
|
||||
@@ -138,7 +141,6 @@ void IFGFeature_Dx12::SetVelocity(ID3D12GraphicsCommandList* cmdList, ID3D12Reso
|
||||
void IFGFeature_Dx12::SetDepth(ID3D12GraphicsCommandList* cmdList, ID3D12Resource* depth, D3D12_RESOURCE_STATES state)
|
||||
{
|
||||
auto index = GetIndex();
|
||||
LOG_TRACE("Setting depth, index: {}", index);
|
||||
|
||||
if (cmdList == nullptr)
|
||||
return;
|
||||
@@ -169,7 +171,10 @@ void IFGFeature_Dx12::SetDepth(ID3D12GraphicsCommandList* cmdList, ID3D12Resourc
|
||||
D3D12_RESOURCE_STATE_COPY_DEST);
|
||||
|
||||
if (result)
|
||||
{
|
||||
LOG_TRACE("Setting depth from flip, index: {}", index);
|
||||
_paramDepth[index] = _paramDepthCopy[index];
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -178,6 +183,7 @@ void IFGFeature_Dx12::SetDepth(ID3D12GraphicsCommandList* cmdList, ID3D12Resourc
|
||||
if (Config::Instance()->FGMakeDepthCopy.value_or_default() &&
|
||||
CopyResource(cmdList, depth, &_paramDepthCopy[index], state))
|
||||
{
|
||||
LOG_TRACE("Setting depth, index: {}", index);
|
||||
_paramDepth[index] = _paramDepthCopy[index];
|
||||
}
|
||||
}
|
||||
@@ -186,12 +192,11 @@ void IFGFeature_Dx12::SetHudless(ID3D12GraphicsCommandList* cmdList, ID3D12Resou
|
||||
D3D12_RESOURCE_STATES state, bool makeCopy)
|
||||
{
|
||||
auto index = GetIndex();
|
||||
LOG_TRACE("Setting hudless, index: {}, resource: {:X}", index, (size_t) hudless);
|
||||
LOG_TRACE("Index: {}, Resource: {:X}, CmdList: {:X}", index, (size_t) hudless, (size_t) cmdList);
|
||||
|
||||
if (cmdList == nullptr && !makeCopy)
|
||||
if (cmdList == nullptr || !makeCopy)
|
||||
{
|
||||
_paramHudless[index] = hudless;
|
||||
SetHudlessReady();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -199,13 +204,11 @@ void IFGFeature_Dx12::SetHudless(ID3D12GraphicsCommandList* cmdList, ID3D12Resou
|
||||
_paramHudless[index] = _paramHudlessCopy[index];
|
||||
else
|
||||
_paramHudless[index] = hudless;
|
||||
|
||||
SetHudlessReady();
|
||||
}
|
||||
|
||||
void IFGFeature_Dx12::CreateObjects(ID3D12Device* InDevice)
|
||||
{
|
||||
return;
|
||||
return;
|
||||
|
||||
// if (_commandAllocators[0] != nullptr)
|
||||
// return;
|
||||
|
||||
@@ -74,7 +74,7 @@ class IFGFeature_Dx12 : public virtual IFGFeature
|
||||
IFGFeature_Dx12() = default;
|
||||
|
||||
// Inherited via IFGFeature
|
||||
void SetVelocityAndDepthReady() override;
|
||||
void SetUpscaleInputsReady() override;
|
||||
void SetHudlessReady() override;
|
||||
void SetHudlessDispatchReady() override;
|
||||
void Present() override;
|
||||
|
||||
@@ -96,6 +96,8 @@ bool FSRFG_Dx12::Dispatch(ID3D12GraphicsCommandList* cmdList, ID3D12Resource* ou
|
||||
{
|
||||
LOG_DEBUG("(FG) running, frame: {0}", _frameCount);
|
||||
|
||||
_lastDispatchedFrame = _frameCount;
|
||||
|
||||
if (State::Instance().FSRFGFTPchanged)
|
||||
ConfigureFramePaceTuning();
|
||||
|
||||
@@ -264,6 +266,8 @@ bool FSRFG_Dx12::Dispatch(ID3D12GraphicsCommandList* cmdList, ID3D12Resource* ou
|
||||
|
||||
bool FSRFG_Dx12::DispatchHudless(ID3D12GraphicsCommandList* cmdList, bool useHudless, double frameTime)
|
||||
{
|
||||
_lastDispatchedFrame = _frameCount;
|
||||
|
||||
LOG_DEBUG("useHudless: {}, frameTime: {}", useHudless, frameTime);
|
||||
|
||||
if (State::Instance().FSRFGFTPchanged)
|
||||
|
||||
Reference in New Issue
Block a user