mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-09-24 14:25:42 +00:00
upscaler & hudless cmdlist could be same
This commit is contained in:
@@ -668,7 +668,7 @@ bool Hudfix_Dx12::CheckForHudless(std::string callerName, ID3D12GraphicsCommandL
|
||||
//_commandQueue->ExecuteCommandLists(1, cmdLists);
|
||||
|
||||
_skipHudlessChecks = true;
|
||||
//DispatchFG(true);
|
||||
DispatchFG(true);
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ private:
|
||||
// Check _captureCounter for current frame
|
||||
static bool CheckCapture();
|
||||
|
||||
static void DispatchFG(bool useHudless);
|
||||
|
||||
static int GetIndex();
|
||||
|
||||
inline static IID streamlineRiid{};
|
||||
@@ -120,5 +122,4 @@ public:
|
||||
// Reset frame counters
|
||||
static void ResetCounters();
|
||||
|
||||
static void DispatchFG(bool useHudless);
|
||||
};
|
||||
@@ -972,19 +972,16 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
|
||||
LOG_DEBUG("InFeatureHandle is null");
|
||||
return NVSDK_NGX_Result_FAIL_FeatureNotFound;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("Handle: {0}", InFeatureHandle->Id);
|
||||
}
|
||||
|
||||
auto handleId = InFeatureHandle->Id;
|
||||
|
||||
if (!InCmdList)
|
||||
if (InCmdList == nullptr)
|
||||
{
|
||||
LOG_ERROR("InCmdList is null!!!");
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
|
||||
LOG_DEBUG("Handle: {}, CmdList: {:X}", InFeatureHandle->Id, (size_t)InCmdList);
|
||||
auto handleId = InFeatureHandle->Id;
|
||||
|
||||
if (handleId < DLSS_MOD_ID_OFFSET)
|
||||
{
|
||||
if (Config::Instance()->DLSSEnabled.value_or_default() && NVNGXProxy::D3D12_EvaluateFeature() != nullptr)
|
||||
@@ -1505,7 +1502,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FG Prepare
|
||||
ID3D12Resource* output = nullptr;
|
||||
if (InParameters->Get(NVSDK_NGX_Parameter_Output, &output) != NVSDK_NGX_Result_Success)
|
||||
|
||||
@@ -981,36 +981,19 @@ void ResTrack_Dx12::hkExecuteCommandLists(ID3D12CommandQueue* This, UINT NumComm
|
||||
|
||||
for (size_t i = 0; i < NumCommandLists; i++)
|
||||
{
|
||||
LOG_DEBUG_ONLY("cmdlist[{}]: {:X}", i, (size_t)ppCommandLists[i]);
|
||||
|
||||
if (ppCommandLists[i] == _commandList)
|
||||
{
|
||||
LOG_DEBUG("Hudless cmdlist");
|
||||
This->Signal(State::Instance().currentFG->GetHudlessFence(), State::Instance().currentFG->FrameCount());
|
||||
|
||||
if (_upscalerCommandList == nullptr)
|
||||
{
|
||||
LOG_DEBUG("Upscaler cmdlist is nullptr, dispatching FG");
|
||||
Hudfix_Dx12::DispatchFG(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("Upscaler cmdlist is not nullptr, waiting for it!");
|
||||
_dispatchAfterUpscale = true;
|
||||
}
|
||||
|
||||
_commandList = nullptr;
|
||||
}
|
||||
else if (ppCommandLists[i] == _upscalerCommandList)
|
||||
|
||||
if (ppCommandLists[i] == _upscalerCommandList)
|
||||
{
|
||||
LOG_DEBUG("Upscaler cmdlist");
|
||||
This->Signal(State::Instance().currentFG->GetCopyFence(), State::Instance().currentFG->FrameCount());
|
||||
|
||||
if (_dispatchAfterUpscale)
|
||||
{
|
||||
LOG_DEBUG("Upscaler cmdlist, dispatching FG");
|
||||
Hudfix_Dx12::DispatchFG(true);
|
||||
_dispatchAfterUpscale = false;
|
||||
}
|
||||
|
||||
_upscalerCommandList = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -1853,6 +1836,17 @@ void ResTrack_Dx12::hkDrawIndexedInstanced(ID3D12GraphicsCommandList* This, UINT
|
||||
void ResTrack_Dx12::hkExecuteBundle(ID3D12GraphicsCommandList* This, ID3D12GraphicsCommandList* pCommandList)
|
||||
{
|
||||
o_ExecuteBundle(This, pCommandList);
|
||||
|
||||
if (pCommandList == _commandList)
|
||||
{
|
||||
LOG_DEBUG("Hudless cmdlist");
|
||||
_commandList = This;
|
||||
}
|
||||
else if (pCommandList == _upscalerCommandList)
|
||||
{
|
||||
LOG_DEBUG("Upscaler cmdlist");
|
||||
_upscalerCommandList = This;
|
||||
}
|
||||
}
|
||||
|
||||
void ResTrack_Dx12::hkDispatch(ID3D12GraphicsCommandList* This, UINT ThreadGroupCountX, UINT ThreadGroupCountY, UINT ThreadGroupCountZ)
|
||||
@@ -2189,8 +2183,8 @@ void ResTrack_Dx12::ClearPossibleHudless()
|
||||
_rcActive = false;
|
||||
_cmdList = false;
|
||||
|
||||
_upscalerCommandList = nullptr;
|
||||
_commandList = nullptr;
|
||||
//_upscalerCommandList = nullptr;
|
||||
//_commandList = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -2201,6 +2195,7 @@ void ResTrack_Dx12::PresentDone()
|
||||
|
||||
void ResTrack_Dx12::SetUpscalerCmdList(ID3D12GraphicsCommandList* cmdList)
|
||||
{
|
||||
LOG_DEBUG("cmdList: {:X}", (size_t)cmdList);
|
||||
_upscalerCommandList = cmdList;
|
||||
}
|
||||
|
||||
|
||||
@@ -287,8 +287,6 @@ private:
|
||||
|
||||
inline static ID3D12GraphicsCommandList* _commandList = nullptr;
|
||||
inline static ID3D12GraphicsCommandList* _upscalerCommandList = nullptr;
|
||||
inline static bool _dispatchAfterUpscale = false;
|
||||
|
||||
|
||||
static bool IsHudFixActive();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user