some fixes

This commit is contained in:
cdozdil
2024-11-21 22:32:29 +03:00
parent 17959b1588
commit bb63c57eda
5 changed files with 25 additions and 9 deletions
+4 -3
View File
@@ -1423,8 +1423,8 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
auto fIndex = fgCallbackFrameIndex;
// check for status
if (!Config::Instance()->FGEnabled.value_or(false) || Config::Instance()->FGChanged ||
FrameGen_Dx12::fgContext == nullptr
if (!Config::Instance()->FGEnabled.value_or(false) ||
FrameGen_Dx12::fgContext == nullptr || Config::Instance()->SCChanged
#ifdef USE_QUEUE_FOR_FG
|| FrameGen_Dx12::fgCommandList[fIndex] == nullptr || FrameGen_Dx12::fgCommandQueue == nullptr
#endif
@@ -1437,7 +1437,8 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCom
// If fg is active but upscaling paused
if (Config::Instance()->CurrentFeature == nullptr || !FrameGen_Dx12::fgIsActive ||
fgLastFGFrame == Config::Instance()->CurrentFeature->FrameCount())
Config::Instance()->FGChanged || fgLastFGFrame == Config::Instance()->CurrentFeature->FrameCount() ||
Config::Instance()->CurrentFeature->FrameCount() == 0)
{
LOG_WARN("(FG) Callback without active FG! fIndex:{}", fIndex);
+1 -1
View File
@@ -82,7 +82,7 @@
<IncludePath>$(SolutionDir)external\vulkan\include;$(SolutionDir)external\nvngx_dlss_sdk;$(SolutionDir)external\xess\inc\xess;$(SolutionDir)external\FidelityFX-SDK\ffx-api\include\ffx_api;$(SolutionDir)external\simpleini;$(SolutionDir)external\unordered_dense\include;$(SolutionDir)external\spdlog\include;$(SolutionDir)external\freetype;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)fsr2\lib;$(ProjectDir)fsr2_212\lib;$(ProjectDir)fsr31\lib;$(ProjectDir)vulkan;$(ProjectDir)d3dx;$(ProjectDir)detours;$(SolutionDir)external\xess\lib;$(SolutionDir)external\freetype;$(LibraryPath)</LibraryPath>
<TargetName>dxgi</TargetName>
<OutDir>E:\Games\Deep Rock Galactic\FSD\Binaries\Win64\</OutDir>
<OutDir>D:\Folders\Games\Cyberpunk 2077\bin\x64\</OutDir>
<IntDir>.\x64\Debug</IntDir>
<TargetExt>.dll</TargetExt>
</PropertyGroup>
+6 -4
View File
@@ -554,8 +554,9 @@ static void GetHudless(ID3D12GraphicsCommandList* This)
auto fIndex = fgCallbackFrameIndex;
// check for status
if (!Config::Instance()->FGEnabled.value_or(false) || !Config::Instance()->FGHUDFix.value_or(false) || Config::Instance()->FGChanged ||
FrameGen_Dx12::fgContext == nullptr || FrameGen_Dx12::fgCommandList[fIndex] == nullptr || FrameGen_Dx12::fgCommandQueue == nullptr)
if (!Config::Instance()->FGEnabled.value_or(false) || !Config::Instance()->FGHUDFix.value_or(false) ||
FrameGen_Dx12::fgContext == nullptr || FrameGen_Dx12::fgCommandList[fIndex] == nullptr ||
FrameGen_Dx12::fgCommandQueue == nullptr || Config::Instance()->SCChanged)
{
LOG_WARN("Cancel async dispatch");
fgDispatchCalled = false;
@@ -564,8 +565,9 @@ static void GetHudless(ID3D12GraphicsCommandList* This)
}
// If fg is active but upscaling paused
if (!fgDispatchCalled || Config::Instance()->CurrentFeature == nullptr ||
fgLastFGFrame == Config::Instance()->CurrentFeature->FrameCount() || !FrameGen_Dx12::fgIsActive)
if (!fgDispatchCalled || Config::Instance()->CurrentFeature == nullptr || Config::Instance()->FGChanged ||
fgLastFGFrame == Config::Instance()->CurrentFeature->FrameCount() || !FrameGen_Dx12::fgIsActive ||
Config::Instance()->CurrentFeature->FrameCount() == 0)
{
LOG_WARN("Callback without hudless! frameID: {}", params->frameID);
+13
View File
@@ -2,6 +2,7 @@
#include "../Config.h"
#include "../Util.h"
#include "HooksDx.h"
// Used RenderDoc's wrapped object as referance
// https://github.com/baldurk/renderdoc/blob/v1.x/renderdoc/driver/dxgi/dxgi_wrapped.cpp
@@ -117,6 +118,8 @@ HRESULT WrappedIDXGISwapChain4::ResizeBuffers(UINT BufferCount, UINT Width, UINT
{
LOG_DEBUG("");
FrameGen_Dx12::ffxMutex.lock();
HRESULT result;
DXGI_SWAP_CHAIN_DESC desc{};
GetDesc(&desc);
@@ -220,6 +223,8 @@ HRESULT WrappedIDXGISwapChain4::ResizeBuffers(UINT BufferCount, UINT Width, UINT
LOG_DEBUG("result: {0:X}", (UINT)result);
FrameGen_Dx12::ffxMutex.unlock();
return result;
}
@@ -231,6 +236,8 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain4::GetContainingOutput(IDXGIOutpu
HRESULT WrappedIDXGISwapChain4::ResizeBuffers1(UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT Format, UINT SwapChainFlags,
const UINT* pCreationNodeMask, IUnknown* const* ppPresentQueue)
{
FrameGen_Dx12::ffxMutex.lock();
LOG_DEBUG("");
HRESULT result;
@@ -333,11 +340,15 @@ HRESULT WrappedIDXGISwapChain4::ResizeBuffers1(UINT BufferCount, UINT Width, UIN
LOG_DEBUG("result: {0:X}", (UINT)result);
FrameGen_Dx12::ffxMutex.unlock();
return result;
}
HRESULT WrappedIDXGISwapChain4::SetFullscreenState(BOOL Fullscreen, IDXGIOutput* pTarget)
{
FrameGen_Dx12::ffxMutex.lock();
auto result = m_pReal->SetFullscreenState(Fullscreen, pTarget);
LOG_DEBUG("Fullscreen: {}", Fullscreen);
@@ -385,6 +396,8 @@ HRESULT WrappedIDXGISwapChain4::SetFullscreenState(BOOL Fullscreen, IDXGIOutput*
LOG_DEBUG("result: {0:X}", (UINT)result);
FrameGen_Dx12::ffxMutex.unlock();
return result;
}
+1 -1
View File
@@ -21,7 +21,7 @@
#define VER_MAJOR_VERSION 0
#define VER_MINOR_VERSION 7
#define VER_HOTFIX_VERSION 0
#define VER_BUILD_NUMBER 66
#define VER_BUILD_NUMBER 67
#define VER_PRE_RELEASE