add condutions for signatures

This commit is contained in:
cdozdil
2024-12-13 01:33:54 +03:00
parent 5e38353020
commit 0de5e27fac
+3 -4
View File
@@ -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<std::shared_mutex> 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<std::shared_mutex> 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;