From 6e920522fa4e3172849ea7ea6678a1aa0e75aca4 Mon Sep 17 00:00:00 2001 From: cdozdil <35529761+cdozdil@users.noreply.github.com> Date: Sat, 2 Mar 2024 13:02:43 +0300 Subject: [PATCH] Update XeSSFeature_Dx11.cpp Always update internal dx11 device and context --- CyberXeSS/XeSSFeature_Dx11.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/CyberXeSS/XeSSFeature_Dx11.cpp b/CyberXeSS/XeSSFeature_Dx11.cpp index fa7196ce..c705c6c4 100644 --- a/CyberXeSS/XeSSFeature_Dx11.cpp +++ b/CyberXeSS/XeSSFeature_Dx11.cpp @@ -278,28 +278,22 @@ bool XeSSFeatureDx11::Init(ID3D11Device* device, ID3D11DeviceContext* context, c return false; } - if (!Dx11DeviceContext) + auto contextResult = context->QueryInterface(IID_PPV_ARGS(&Dx11DeviceContext)); + if (contextResult != S_OK) { - auto contextResult = context->QueryInterface(IID_PPV_ARGS(&Dx11DeviceContext)); - if (contextResult != S_OK) - { - spdlog::error("XeSSFeatureDx11::Init QueryInterface ID3D11DeviceContext4 result: {0:x}", contextResult); - return false; - } + spdlog::error("XeSSFeatureDx11::Init QueryInterface ID3D11DeviceContext4 result: {0:x}", contextResult); + return false; } if (!device) Dx11DeviceContext->GetDevice(&device); - if (!Dx11Device) - { - auto dx11DeviceResult = device->QueryInterface(IID_PPV_ARGS(&Dx11Device)); + auto dx11DeviceResult = device->QueryInterface(IID_PPV_ARGS(&Dx11Device)); - if (dx11DeviceResult != S_OK) - { - spdlog::error("XeSSFeatureDx11::Init QueryInterface ID3D11Device5 result: {0:x}", dx11DeviceResult); - return false; - } + if (dx11DeviceResult != S_OK) + { + spdlog::error("XeSSFeatureDx11::Init QueryInterface ID3D11Device5 result: {0:x}", dx11DeviceResult); + return false; } if (!Dx12on11Device)