diff --git a/OptiScaler.ini b/OptiScaler.ini index 1ed093be..7254ce96 100644 --- a/OptiScaler.ini +++ b/OptiScaler.ini @@ -283,19 +283,6 @@ OverrideForceDMFG=auto ; Default (auto) is 0.0 (monitor's refresh rate) FramerateTargetDMFG=auto -; Any set of flags is accepted, for example 0x14100000 -; For reference https://github.com/artur-graniszewski/dlss-enabler-main/blob/a92464d468eb0d91ae17befa66c6bf6229f20b9f/Utils/DlssgProxy.cpp#L1033 -; Any set of flags - Default (auto) is 0 -DispatchFlags = auto - -; Controls value set to DLSSG.ShowDebug -; uint32_t - Default (auto) is 0 -ShowDebug = auto - -; Disable hudless resource being sent to DLSSG -; Might be required for some sets of DispatchFlags, see the reference -; true or false - Default (auto) is false -DisableHudless = auto ; ------------------------------------------------------- @@ -705,6 +692,21 @@ RenderPresetUltraPerformance=auto ; true or false - Default (auto) is false MakeDepthCopy=auto +; Any set of flags is accepted, for example 0x14100000 +; For reference https://github.com/artur-graniszewski/dlss-enabler-main/blob/a92464d468eb0d91ae17befa66c6bf6229f20b9f/Utils/DlssgProxy.cpp#L1033 +; Any set of flags - Default (auto) is 0x10000000 (IGNORE_UI_TEXTURE) +DispatchFlags = auto + +; Controls value set to DLSSG.ShowDebug +; Seems to be displaying just the interpolated frames +; uint32_t - Default (auto) is 0 +ShowDebug = auto + +; Disable hudless resource being sent to DLSSG +; Might be required for some sets of DispatchFlags, see the reference +; true or false - Default (auto) is false +DisableHudless = auto + ; ------------------------------------------------------- diff --git a/OptiScaler/Config.cpp b/OptiScaler/Config.cpp index fde5ce19..77da35c6 100644 --- a/OptiScaler/Config.cpp +++ b/OptiScaler/Config.cpp @@ -225,9 +225,6 @@ bool Config::Reload(std::filesystem::path iniPath) FGDLSSGFramerateTargetDMFG.set_from_config(readFloat("DLSSG", "FramerateTargetDMFG")); FGDLSSGOverrideForceDMFG.set_from_config(readBool("DLSSG", "OverrideForceDMFG")); - FGDLSSGDispatchFlags.set_from_config(readUInt("DLSSG", "DispatchFlags")); - FGDLSSGShowDebug.set_from_config(readUInt("DLSSG", "ShowDebug")); - FGDLSSGDisableHudless.set_from_config(readBool("DLSSG", "DisableHudless")); } // FSR FG Inputs @@ -370,9 +367,12 @@ bool Config::Reload(std::filesystem::path iniPath) DLSSDRenderPresetUltraPerformance.set_from_config(setting); } - // Nvngx_FG + // NvngxFG { - MakeDepthCopy.set_from_config(readBool("Nvngx_FG", "MakeDepthCopy")); + NvngxFGMakeDepthCopy.set_from_config(readBool("NvngxFG", "MakeDepthCopy")); + NvngxFGDispatchFlags.set_from_config(readUInt("NvngxFG", "DispatchFlags")); + NvngxFGShowDebug.set_from_config(readUInt("NvngxFG", "ShowDebug")); + NvngxFGDisableHudless.set_from_config(readBool("NvngxFG", "DisableHudless")); } // Logging @@ -978,11 +978,6 @@ bool Config::SaveIni() GetFloatValue(Instance()->FGDLSSGFramerateTargetDMFG.value_for_config()).c_str()); ini.SetValue("DLSSG", "OverrideForceDMFG", GetBoolValue(Instance()->FGDLSSGOverrideForceDMFG.value_for_config()).c_str()); - ini.SetValue("DLSSG", "DispatchFlags", - GetIntValue(Instance()->FGDLSSGDispatchFlags.value_for_config(), true).c_str()); - ini.SetValue("DLSSG", "ShowDebug", GetIntValue(Instance()->FGDLSSGShowDebug.value_for_config()).c_str()); - ini.SetValue("DLSSG", "DisableHudless", - GetBoolValue(Instance()->FGDLSSGDisableHudless.value_for_config()).c_str()); } // OptiFG @@ -1148,7 +1143,13 @@ bool Config::SaveIni() // NvngxFG { - ini.SetValue("NvngxFG", "MakeDepthCopy", GetBoolValue(Instance()->MakeDepthCopy.value_for_config()).c_str()); + ini.SetValue("NvngxFG", "MakeDepthCopy", + GetBoolValue(Instance()->NvngxFGMakeDepthCopy.value_for_config()).c_str()); + ini.SetValue("NvngxFG", "DispatchFlags", + GetIntValue(Instance()->NvngxFGDispatchFlags.value_for_config(), true).c_str()); + ini.SetValue("NvngxFG", "ShowDebug", GetIntValue(Instance()->NvngxFGShowDebug.value_for_config()).c_str()); + ini.SetValue("NvngxFG", "DisableHudless", + GetBoolValue(Instance()->NvngxFGDisableHudless.value_for_config()).c_str()); } // Sharpness diff --git a/OptiScaler/Config.h b/OptiScaler/Config.h index 606f8f86..1dde93dc 100644 --- a/OptiScaler/Config.h +++ b/OptiScaler/Config.h @@ -274,7 +274,7 @@ class Config CustomOptional DLSSDRenderPresetUltraPerformance { 0 }; // Nukems - CustomOptional MakeDepthCopy { false }; + CustomOptional NvngxFGMakeDepthCopy { false }; // Libraries CustomOptional MainDllPath; @@ -609,9 +609,9 @@ class Config // As per // https://github.com/artur-graniszewski/dlss-enabler-main/blob/a92464d468eb0d91ae17befa66c6bf6229f20b9f/Utils/DlssgProxy.cpp#L1033 - CustomOptional FGDLSSGDispatchFlags { 0 }; - CustomOptional FGDLSSGShowDebug { 0 }; - CustomOptional FGDLSSGDisableHudless { false }; + CustomOptional NvngxFGDispatchFlags { 0x10000000 }; // IGNORE_UI_TEXTURE + CustomOptional NvngxFGShowDebug { 0 }; + CustomOptional NvngxFGDisableHudless { false }; // fakenvapi CustomOptional UseFakenvapi { true }; diff --git a/OptiScaler/framegen/nvngx/Nvngx_FG.cpp b/OptiScaler/framegen/nvngx/Nvngx_FG.cpp index 4cb3ae0a..89b78ef9 100644 --- a/OptiScaler/framegen/nvngx/Nvngx_FG.cpp +++ b/OptiScaler/framegen/nvngx/Nvngx_FG.cpp @@ -377,7 +377,7 @@ NVSDK_NGX_Result Nvngx_FG::D3D12_EvaluateFeature(ID3D12GraphicsCommandList* InCm // Fixes an issue with the depth being corrupted on AMD under Windows ID3D12Resource* dlssgDepth = nullptr; - if (Config::Instance()->MakeDepthCopy.value_or_default()) + if (Config::Instance()->NvngxFGMakeDepthCopy.value_or_default()) InParameters->Get("DLSSG.Depth", &dlssgDepth); if (dlssgDepth) @@ -459,9 +459,9 @@ NVSDK_NGX_Result Nvngx_FG::D3D12_EvaluateFeature(ID3D12GraphicsCommandList* InCm } } - uint32_t showDebug = Config::Instance()->FGDLSSGShowDebug.value_or_default(); - uint32_t flags = Config::Instance()->FGDLSSGDispatchFlags.value_or_default(); - bool disableHudless = Config::Instance()->FGDLSSGDisableHudless.value_or_default(); + uint32_t showDebug = Config::Instance()->NvngxFGShowDebug.value_or_default(); + uint32_t flags = Config::Instance()->NvngxFGDispatchFlags.value_or_default(); + bool disableHudless = Config::Instance()->NvngxFGDisableHudless.value_or_default(); InParameters->Set("DLSSG.ShowDebug", showDebug); InParameters->Set("DLSSG.DispatchFlags", flags); diff --git a/OptiScaler/hooks/Streamline_Hooks.cpp b/OptiScaler/hooks/Streamline_Hooks.cpp index 272293a1..aa458cda 100644 --- a/OptiScaler/hooks/Streamline_Hooks.cpp +++ b/OptiScaler/hooks/Streamline_Hooks.cpp @@ -396,14 +396,6 @@ sl::Result StreamlineHooks::hkslSetTag(const sl::ViewportHandle& viewport, const else if (State::Instance().activeFgInput == FGInput::NvngxFG) { LOG_TRACE("Tagging resource of type: {}", magic_enum::enum_name(typeEnum)); - - // Workaround a bug in the FSR 3 MFG mod where it composits the UI incorrectly - auto nvngxFgApi = renderApi == sl::RenderAPI::eD3D12 ? API::DX12 : API::NotSelected; - if (tags[i].type == sl::kBufferTypeUIColorAndAlpha && tags[i].resource->native && - Nvngx_FG::getMaxFakeFramesCount(nvngxFgApi) > 1) - { - tags[i].resource->native = nullptr; - } } } @@ -484,14 +476,6 @@ sl::Result StreamlineHooks::hkslSetTagForFrame(const sl::FrameToken& frame, cons else if (State::Instance().activeFgInput == FGInput::NvngxFG) { LOG_TRACE("Tagging resource of type: {}", magic_enum::enum_name(typeEnum)); - - // Workaround a bug in the FSR 3 MFG mod where it composits the UI incorrectly - auto nvngxFgApi = renderApi == sl::RenderAPI::eD3D12 ? API::DX12 : API::NotSelected; - if (resources[i].type == sl::kBufferTypeUIColorAndAlpha && resources[i].resource->native && - Nvngx_FG::getMaxFakeFramesCount(nvngxFgApi) > 1) - { - resources[i].resource->native = nullptr; - } } } diff --git a/OptiScaler/menu/menu_common.cpp b/OptiScaler/menu/menu_common.cpp index f917b54d..c0e316f9 100644 --- a/OptiScaler/menu/menu_common.cpp +++ b/OptiScaler/menu/menu_common.cpp @@ -4396,10 +4396,10 @@ void MenuCommon::RenderFrameGenerationRuntimeSettings(RenderMenuContext& ctx) if (!primaryGpu.dlssCapable && primaryGpu.fsr4Support == FSR4Support::None && !primaryGpu.usesVkd3dProton && !isUnrealEngine) { - if (bool makeDepthCopy = config->MakeDepthCopy.value_or_default(); + if (bool makeDepthCopy = config->NvngxFGMakeDepthCopy.value_or_default(); ImGui::Checkbox("Fix broken visuals", &makeDepthCopy)) { - config->MakeDepthCopy = makeDepthCopy; + config->NvngxFGMakeDepthCopy = makeDepthCopy; } ShowHelpMarker("Makes a copy of the depth buffer\nCan fix broken visuals in some games on AMD " "GPUs under Windows\nCan cause stutters, so best to use only when necessary"); @@ -4415,19 +4415,19 @@ void MenuCommon::RenderFrameGenerationRuntimeSettings(RenderMenuContext& ctx) if (Nvngx_FG::isLoaded(state.swapchainApi)) { - if (bool disableHudless = config->FGDLSSGDisableHudless.value_or_default(); + if (bool disableHudless = config->NvngxFGDisableHudless.value_or_default(); ImGui::Checkbox("Disable Hudless", &disableHudless)) { - config->FGDLSSGDisableHudless = disableHudless; + config->NvngxFGDisableHudless = disableHudless; } ShowHelpMarker("Might be required for some sets of DispatchFlags"); if (Nvngx_FG::getMaxFakeFramesCount(state.swapchainApi) > 1) { - if (bool showDebug = config->FGDLSSGShowDebug.value_or_default(); + if (bool showDebug = config->NvngxFGShowDebug.value_or_default(); ImGui::Checkbox("Show Debug", &showDebug)) { - config->FGDLSSGShowDebug = showDebug; + config->NvngxFGShowDebug = showDebug; } ShowHelpMarker("Required for Debug flags to work correctly"); @@ -4449,7 +4449,7 @@ void MenuCommon::RenderFrameGenerationRuntimeSettings(RenderMenuContext& ctx) { "PIN_BACKBUFFER", 0x40000000, "Pin DLSSG.Backbuffer to subframe-1 snapshot across MFG frame" } }; - uint32_t temp_flags = config->FGDLSSGDispatchFlags.value_or_default(); + uint32_t temp_flags = config->NvngxFGDispatchFlags.value_or_default(); bool changed = false; ImGui::Text("Raw DispatchFlags:"); @@ -4474,7 +4474,7 @@ void MenuCommon::RenderFrameGenerationRuntimeSettings(RenderMenuContext& ctx) if (changed) { - config->FGDLSSGDispatchFlags = temp_flags; + config->NvngxFGDispatchFlags = temp_flags; } } else