From 0de5e27fac74158fd1d81672ec8a780167f92da2 Mon Sep 17 00:00:00 2001 From: cdozdil Date: Fri, 13 Dec 2024 01:33:54 +0300 Subject: [PATCH] add condutions for signatures --- OptiScaler/NVNGX_DLSS_Dx12.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OptiScaler/NVNGX_DLSS_Dx12.cpp b/OptiScaler/NVNGX_DLSS_Dx12.cpp index 83c6167b..afdea112 100644 --- a/OptiScaler/NVNGX_DLSS_Dx12.cpp +++ b/OptiScaler/NVNGX_DLSS_Dx12.cpp @@ -129,7 +129,7 @@ static int64_t GetTicks() static void hkSetComputeRootSignature(ID3D12GraphicsCommandList* commandList, ID3D12RootSignature* pRootSignature) { - if (!contextRendering && commandList != nullptr && pRootSignature != nullptr) + if (Config::Instance()->RestoreComputeSignature.value_or(true) && !contextRendering && commandList != nullptr && pRootSignature != nullptr) { std::unique_lock lock(computeSigatureMutex); computeSignatures.insert_or_assign(commandList, pRootSignature); @@ -140,7 +140,7 @@ static void hkSetComputeRootSignature(ID3D12GraphicsCommandList* commandList, ID static void hkSetGraphicRootSignature(ID3D12GraphicsCommandList* commandList, ID3D12RootSignature* pRootSignature) { - if (!contextRendering && commandList != nullptr && pRootSignature != nullptr) + if (Config::Instance()->RestoreGraphicSignature.value_or(false) && !contextRendering && commandList != nullptr && pRootSignature != nullptr) { std::unique_lock lock(graphSigatureMutex); graphicSignatures.insert_or_assign(commandList, pRootSignature); @@ -279,8 +279,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApp } // early hooking for signatures - if (orgSetComputeRootSignature == nullptr && - (Config::Instance()->RestoreComputeSignature.value_or(true) || Config::Instance()->RestoreGraphicSignature.value_or(false))) + if (orgSetComputeRootSignature == nullptr) { ID3D12CommandAllocator* alloc = nullptr; ID3D12GraphicsCommandList* gcl = nullptr;