From 46037cda1f04bdb05c34441ee492f1072b867dee Mon Sep 17 00:00:00 2001 From: cdozdil Date: Sun, 31 Dec 2023 00:56:23 +0300 Subject: [PATCH] removed unnecessary shared fence --- CyberXeSS/CyberXessDx11.cpp | 29 +---------------------------- CyberXeSS/pch.h | 2 +- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/CyberXeSS/CyberXessDx11.cpp b/CyberXeSS/CyberXessDx11.cpp index 28ffe474..fc461067 100644 --- a/CyberXeSS/CyberXessDx11.cpp +++ b/CyberXeSS/CyberXessDx11.cpp @@ -51,8 +51,6 @@ static ID3D11Texture2D* tmShared = nullptr; static ID3D11Texture2D* expShared = nullptr; ID3D12Fence* d3d12Fence = nullptr; -ID3D11Fence* d3d11Fence = nullptr; -HANDLE fenceHandle = NULL; xess_d3d12_execute_params_t params{}; @@ -791,7 +789,6 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_ReleaseFeature(NVSDK_NGX_Handle* InHandle) { ReleaseSharedResources(); CyberXessContext::instance()->Shutdown(true, false); - } isDeviceBusy.store(false); @@ -926,7 +923,7 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceContext* InDevCtx, // Fence for syncing if (d3d12Fence == nullptr) { - result = instance->Dx12Device->CreateFence(0, D3D12_FENCE_FLAG_SHARED, IID_PPV_ARGS(&d3d12Fence)); + result = instance->Dx12Device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&d3d12Fence)); if (result != S_OK) { @@ -936,30 +933,6 @@ NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceContext* InDevCtx, } } - if (fenceHandle == NULL) - { - result = instance->Dx12Device->CreateSharedHandle(d3d12Fence, NULL, GENERIC_ALL, nullptr, &fenceHandle); - - if (result != S_OK) - { - LOG("NVSDK_NGX_D3D11_EvaluateFeature CreateFence fenceHandle result: " + int_to_hex(result), LEVEL_DEBUG); - isDeviceBusy.store(false); - return NVSDK_NGX_Result_FAIL_InvalidParameter; - } - } - - if (d3d11Fence == nullptr) - { - result = instance->Dx11Device->OpenSharedFence(fenceHandle, IID_PPV_ARGS(&d3d11Fence)); - - if (result != S_OK) - { - LOG("NVSDK_NGX_D3D11_EvaluateFeature CreateFence d3d11fence result: " + int_to_hex(result), LEVEL_DEBUG); - isDeviceBusy.store(false); - return NVSDK_NGX_Result_FAIL_InvalidParameter; - } - } - // creatimg params for XeSS xess_result_t xessResult; diff --git a/CyberXeSS/pch.h b/CyberXeSS/pch.h index 92a55a6b..32d38544 100644 --- a/CyberXeSS/pch.h +++ b/CyberXeSS/pch.h @@ -1,7 +1,7 @@ #pragma once #include "framework.h" -#define LOGGING_ACTIVE +//#define LOGGING_ACTIVE typedef enum _log_level_t {