Add DLSS Dx11 w/Dx12 and DLSS Vk w/Dx12

Let's you use the DX12 DLSS on DX11 and VK
This commit is contained in:
FakeMichau committed 2026-10-01 15:50:50 +02:00
1 parent 5dc144e29a
commit 435609d408
12 files changed
+132 -25

No files matched your search

+4
View File
@@ -438,6 +438,8 @@ copy NUL "$(SolutionDir)x64\Release\a\!! EXTRACT ALL FILES TO GAME FOLDER !!" /Y
<ClInclude Include="shaders\Shader_Vk.h" />
<ClInclude Include="shaders\Shader_VkUtils.h" />
<ClInclude Include="low_latency\input\input_uell.h" />
<ClInclude Include="upscalers\dlss\DLSSFeature_Dx11On12.h" />
<ClInclude Include="upscalers\dlss\DLSSFeature_VkOnDx12.h" />
<ClInclude Include="upscalers\fsr2_212\FSR2Feature_VkOnDx12_212.h" />
<ClInclude Include="upscalers\ffx\FFXFeature_VkOn12.h" />
<ClInclude Include="upscalers\fsr31\FSR31Feature.h" />
@@ -700,6 +702,8 @@ copy NUL "$(SolutionDir)x64\Release\a\!! EXTRACT ALL FILES TO GAME FOLDER !!" /Y
<ClCompile Include="spoofing\User32_Spoofing.cpp" />
<ClCompile Include="spoofing\Vulkan_Spoofing.cpp" />
<ClCompile Include="low_latency\input\input_uell.cpp" />
<ClCompile Include="upscalers\dlss\DLSSFeature_Dx11On12.cpp" />
<ClCompile Include="upscalers\dlss\DLSSFeature_VkOnDx12.cpp" />
<ClCompile Include="upscalers\fsr2_212\FSR2Feature_VkOnDx12_212.cpp" />
<ClCompile Include="upscalers\ffx\FFXFeature_VkOn12.cpp" />
<ClCompile Include="upscalers\fsr31\FSR31Feature.cpp" />
+12
View File
@@ -983,6 +983,12 @@
<ClInclude Include="framegen\reprojection\swapchain\reprojectionSwapchain.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="upscalers\dlss\DLSSFeature_Dx11On12.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="upscalers\dlss\DLSSFeature_VkOnDx12.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Config.cpp">
@@ -1592,6 +1598,12 @@
<ClCompile Include="framegen\reprojection\swapchain\reprojectionSwapchain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="upscalers\dlss\DLSSFeature_Dx11On12.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="upscalers\dlss\DLSSFeature_VkOnDx12.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="OptiScaler.rc" />
+13 -6
View File
@@ -76,6 +76,9 @@ std::string UpscalerDisplayName(Upscaler upscaler, API api)
case Upscaler::DLSS:
return "DLSS";
case Upscaler::DLSS_on12:
return "DLSS w/Dx12";
case Upscaler::DLSSD:
return "DLSSD";
}
@@ -112,6 +115,7 @@ std::string UpscalerShortName(Upscaler upscaler)
return "XeSS";
case Upscaler::DLSS:
case Upscaler::DLSS_on12:
return "DLSS";
case Upscaler::DLSSD:
@@ -144,6 +148,8 @@ std::string UpscalerToCode(Upscaler upscaler)
return "ffx_12";
case Upscaler::DLSS:
return "dlss";
case Upscaler::DLSS_on12:
return "dlss_12";
case Upscaler::DLSSD:
return "dlssd";
case Upscaler::FSR31: // DX11 only
@@ -157,12 +163,13 @@ std::string UpscalerToCode(Upscaler upscaler)
Upscaler CodeToUpscaler(const std::string& code)
{
static const std::unordered_map<std::string, Upscaler> mapping = {
{ "xess", Upscaler::XeSS }, { "xess_12", Upscaler::XeSS_on12 },
{ "fsr21", Upscaler::FSR21 }, { "fsr21_12", Upscaler::FSR21_on12 },
{ "fsr22", Upscaler::FSR22 }, { "fsr22_12", Upscaler::FSR22_on12 },
{ "ffx", Upscaler::FFX }, { "ffx_12", Upscaler::FFX_on12 },
{ "dlss", Upscaler::DLSS }, { "dlssd", Upscaler::DLSSD },
{ "fsr31", Upscaler::FSR31 }, { "fsr31_12", Upscaler::FFX_on12 }, // for compat reasons
{ "xess", Upscaler::XeSS }, { "xess_12", Upscaler::XeSS_on12 },
{ "fsr21", Upscaler::FSR21 }, { "fsr21_12", Upscaler::FSR21_on12 },
{ "fsr22", Upscaler::FSR22 }, { "fsr22_12", Upscaler::FSR22_on12 },
{ "ffx", Upscaler::FFX }, { "ffx_12", Upscaler::FFX_on12 },
{ "dlss", Upscaler::DLSS }, { "dlss_12", Upscaler::DLSS_on12 },
{ "dlssd", Upscaler::DLSSD }, { "fsr31", Upscaler::FSR31 },
{ "fsr31_12", Upscaler::FFX_on12 }, // for compat reasons
};
auto it = mapping.find(code);
+2
View File
@@ -64,6 +64,8 @@ enum class Upscaler
DLSS, // "dlss", used for the DLSS upscaler backend
DLSS_on12, // DX12 dlss using interops
DLSSD, // "dlssd", used for the DLSS-D/Ray Reconstruction upscaler+denoiser backend
Reset
};
+1 -1
View File
@@ -825,7 +825,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceConte
auto upscaler = deviceContext->GetUpscalerType();
if (!upscaleResult && !deviceContext->IsInited() &&
(upscaler == Upscaler::XeSS || upscaler == Upscaler::XeSS_on12 || upscaler == Upscaler::DLSS ||
upscaler == Upscaler::FFX_on12))
upscaler == Upscaler::DLSS_on12 || upscaler == Upscaler::FFX_on12))
{
ImGui::InsertNotification({ ImGuiToastType::Error, 10000, "Upscaler failed to run!" });
state.newBackend = Upscaler::FSR22;
+21 -13
View File
@@ -485,7 +485,7 @@ void MenuCommon::RenderUpscalerCombo(const API api, Upscaler currentUpscaler, co
for (auto opt : options)
{
// Check if GPU is capable of a given backend
if (opt == Upscaler::DLSS && !primaryGpu.dlssCapable)
if ((opt == Upscaler::DLSS || opt == Upscaler::DLSS_on12) && !primaryGpu.dlssCapable)
continue;
// Not all Intel GPUs support native DX11 XeSS but don't think we have a good way to check exactly
@@ -506,7 +506,7 @@ void MenuCommon::AddDx11Backends(Upscaler upscaler)
{
RenderUpscalerCombo(API::DX11, upscaler,
{ Upscaler::XeSS, Upscaler::FSR22, Upscaler::FSR31, Upscaler::XeSS_on12, Upscaler::FSR21_on12,
Upscaler::FSR22_on12, Upscaler::FFX_on12, Upscaler::DLSS });
Upscaler::FSR22_on12, Upscaler::FFX_on12, Upscaler::DLSS, Upscaler::DLSS_on12 });
}
void MenuCommon::AddDx12Backends(Upscaler upscaler)
@@ -519,7 +519,7 @@ void MenuCommon::AddVulkanBackends(Upscaler upscaler)
{
RenderUpscalerCombo(API::Vulkan, upscaler,
{ Upscaler::XeSS, Upscaler::FSR21, Upscaler::FSR22, Upscaler::FFX, Upscaler::FSR21_on12,
Upscaler::FFX_on12, Upscaler::DLSS });
Upscaler::FFX_on12, Upscaler::DLSS, Upscaler::DLSS_on12 });
}
template <HasDefaultValue B> void MenuCommon::AddResourceBarrier(std::string name, CustomOptional<int32_t, B>* value)
@@ -1502,9 +1502,11 @@ void MenuCommon::HandleMenuShortcuts(RenderMenuContext& ctx)
if (State::Instance().currentFeature != nullptr)
{
if (State::Instance().currentFeature->GetUpscalerType() == Upscaler::DLSSD)
auto upscalerType = State::Instance().currentFeature->GetUpscalerType();
if (upscalerType == Upscaler::DLSSD)
comboPreset = config->DLSSDRenderPresetForAll.value_or_default();
else if (State::Instance().currentFeature->GetUpscalerType() == Upscaler::DLSS)
else if (upscalerType == Upscaler::DLSS || upscalerType == Upscaler::DLSS_on12)
comboPreset = config->RenderPresetForAll.value_or_default();
}
}
@@ -2975,7 +2977,8 @@ void MenuCommon::RenderActiveUpscalerSettings(RenderMenuContext& ctx)
}
// DLSS -----------------
if ((config->DLSSEnabled.value_or_default() && currentBackend == Upscaler::DLSS &&
if ((config->DLSSEnabled.value_or_default() &&
(currentBackend == Upscaler::DLSS || currentBackend == Upscaler::DLSS_on12) &&
currentFeature->Version().major > 2) ||
usesDlssd)
{
@@ -5473,7 +5476,8 @@ void MenuCommon::RenderActiveImageSettings(RenderMenuContext& ctx)
{
config->OverrideSharpness = overrideSharpness;
if (currentBackend == Upscaler::DLSS && currentFeature->Version().major < 3)
if ((currentBackend == Upscaler::DLSS || currentBackend == Upscaler::DLSS_on12) &&
currentFeature->Version().major < 3)
{
state.newBackend = currentBackend;
MARK_ALL_BACKENDS_CHANGED();
@@ -5504,8 +5508,9 @@ void MenuCommon::RenderActiveImageSettings(RenderMenuContext& ctx)
{
// xess or dlss version >= 2.5.1
constexpr feature_version requiredDlssVersion = { 2, 5, 1 };
rcasEnabled = (currentBackend == Upscaler::XeSS ||
(currentBackend == Upscaler::DLSS && currentFeature->Version() >= requiredDlssVersion));
const bool isDlss = currentBackend == Upscaler::DLSS || currentBackend == Upscaler::DLSS_on12;
rcasEnabled =
currentBackend == Upscaler::XeSS || (isDlss && currentFeature->Version() >= requiredDlssVersion);
ImGui::Spacing();
ImGui::Spacing();
@@ -5808,7 +5813,8 @@ void MenuCommon::RenderActiveImageSettings(RenderMenuContext& ctx)
_ssDownsampler = config->OutputScalingDownscaler.value_or_default();
}
ImGui::BeginDisabled((currentBackend == Upscaler::XeSS || currentBackend == Upscaler::DLSS) &&
ImGui::BeginDisabled((currentBackend == Upscaler::XeSS || currentBackend == Upscaler::DLSS ||
currentBackend == Upscaler::DLSS_on12) &&
currentFeature->RenderWidth() > currentFeature->DisplayWidth());
ImGui::Checkbox("Enable", &_ssEnabled);
ImGui::EndDisabled();
@@ -5936,7 +5942,7 @@ void MenuCommon::RenderActiveImageSettings(RenderMenuContext& ctx)
ImGui::BeginDisabled(!accessToReactiveMask);
bool canUseReactiveMask =
accessToReactiveMask && currentBackend != Upscaler::DLSS &&
accessToReactiveMask && currentBackend != Upscaler::DLSS && currentBackend != Upscaler::DLSS_on12 &&
(currentBackend != Upscaler::XeSS || currentFeature->Version() >= feature_version { 2, 0, 1 });
bool disableReactiveMask = config->DisableReactiveMask.value_or(!canUseReactiveMask);
@@ -6022,7 +6028,8 @@ void MenuCommon::RenderActiveImageSettings(RenderMenuContext& ctx)
ImGui::EndTable();
}
if (currentFeature->AccessToReactiveMask() && currentBackend != Upscaler::DLSS)
if (currentFeature->AccessToReactiveMask() && currentBackend != Upscaler::DLSS &&
currentBackend != Upscaler::DLSS_on12)
{
ImGui::BeginDisabled(config->DisableReactiveMask.value_or(currentBackend == Upscaler::XeSS));
@@ -6203,7 +6210,8 @@ void MenuCommon::RenderAdvancedSettings(RenderMenuContext& ctx)
}
// Non-DLSS hotfixes -----------------------------
if (currentFeature != nullptr && !currentFeature->IsFrozen() && currentBackend != Upscaler::DLSS)
if (currentFeature != nullptr && !currentFeature->IsFrozen() && currentBackend != Upscaler::DLSS &&
currentBackend != Upscaler::DLSS_on12)
{
// SPOOFING/HOOKING -----------------------------
ImGui::Spacing();
+18 -2
View File
@@ -7,6 +7,7 @@
#include "NVNGX_Parameter.h"
#include "upscalers/dlss/DLSSFeature_Dx11.h"
#include "upscalers/dlss/DLSSFeature_Dx11On12.h"
#include "upscalers/dlssd/DLSSDFeature_Dx11.h"
#include "upscalers/fsr2/FSR2Feature_Dx11.h"
#include "upscalers/fsr2/FSR2Feature_Dx11On12.h"
@@ -68,6 +69,19 @@ bool FeatureProvider_Dx11::GetFeature(Upscaler upscaler, UINT handleId, NVSDK_NG
break;
}
case Upscaler::DLSS_on12:
if (primaryGpu.dlssCapable && state.NVNGX_DLSS_Path.has_value())
{
*feature = std::make_unique<DLSSFeatureDx11On12>(handleId, parameters);
break;
}
else
{
*feature = std::make_unique<FSR2FeatureDx11>(handleId, parameters);
upscaler = Upscaler::FSR22;
break;
}
case Upscaler::DLSSD:
if (primaryGpu.dlssCapable && state.NVNGX_DLSSD_Path.has_value())
{
@@ -114,7 +128,8 @@ bool FeatureProvider_Dx11::ChangeFeature(Upscaler upscaler, ID3D11Device* device
State& state = State::Instance();
Config& cfg = *Config::Instance();
const bool dlssOnNonCapable = !IdentifyGpu::getPrimaryGpu().dlssCapable && state.newBackend == Upscaler::DLSS;
const bool dlssOnNonCapable = !IdentifyGpu::getPrimaryGpu().dlssCapable &&
(state.newBackend == Upscaler::DLSS || state.newBackend == Upscaler::DLSS_on12);
if (state.newBackend == Upscaler::Reset || dlssOnNonCapable)
state.newBackend = cfg.Dx11Upscaler.value_or_default();
@@ -135,7 +150,8 @@ bool FeatureProvider_Dx11::ChangeFeature(Upscaler upscaler, ID3D11Device* device
auto* dc = contextData->feature.get();
// Use given params if using DLSS passthrough
const bool isPassthrough = state.newBackend == Upscaler::DLSSD || state.newBackend == Upscaler::DLSS;
const bool isPassthrough = state.newBackend == Upscaler::DLSSD || state.newBackend == Upscaler::DLSS ||
state.newBackend == Upscaler::DLSS_on12;
contextData->createParams = isPassthrough ? parameters : GetNGXParameters(API::DX11, false);
contextData->createParams->Set(NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, dc->GetFeatureFlags());
+19 -3
View File
@@ -8,6 +8,7 @@
#include "upscalers/fsr2/FSR2Feature_Vk.h"
#include "upscalers/dlss/DLSSFeature_Vk.h"
#include "upscalers/dlss/DLSSFeature_VkOnDx12.h"
#include "upscalers/dlssd/DLSSDFeature_Vk.h"
#include "upscalers/fsr2_212/FSR2Feature_Vk_212.h"
#include "upscalers/fsr2_212/FSR2Feature_VkOnDx12_212.h"
@@ -62,6 +63,19 @@ bool FeatureProvider_Vk::GetFeature(Upscaler upscaler, UINT handleId, NVSDK_NGX_
break;
}
case Upscaler::DLSS_on12:
if (primaryGpu.dlssCapable && state.NVNGX_DLSS_Path.has_value())
{
*feature = std::make_unique<DLSSFeatureVkOnDx12>(handleId, parameters);
break;
}
else
{
*feature = std::make_unique<FSR2FeatureVk>(handleId, parameters);
upscaler = Upscaler::FSR22;
break;
}
case Upscaler::DLSSD:
if (primaryGpu.dlssCapable && state.NVNGX_DLSSD_Path.has_value())
{
@@ -109,7 +123,8 @@ bool FeatureProvider_Vk::ChangeFeature(Upscaler upscaler, VkInstance instance, V
State& state = State::Instance();
Config& cfg = *Config::Instance();
const bool dlssOnNonCapable = !IdentifyGpu::getPrimaryGpu().dlssCapable && state.newBackend == Upscaler::DLSS;
const bool dlssOnNonCapable = !IdentifyGpu::getPrimaryGpu().dlssCapable &&
(state.newBackend == Upscaler::DLSS || state.newBackend == Upscaler::DLSS_on12);
if (state.newBackend == Upscaler::Reset || dlssOnNonCapable)
state.newBackend = cfg.VulkanUpscaler.value_or_default();
@@ -126,7 +141,8 @@ bool FeatureProvider_Vk::ChangeFeature(Upscaler upscaler, VkInstance instance, V
auto* dc = contextData->feature.get();
// Use given params if using DLSS passthrough
const bool isPassthrough = state.newBackend == Upscaler::DLSSD || state.newBackend == Upscaler::DLSS;
const bool isPassthrough = state.newBackend == Upscaler::DLSSD || state.newBackend == Upscaler::DLSS ||
state.newBackend == Upscaler::DLSS_on12;
contextData->createParams = isPassthrough ? parameters : GetNGXParameters(API::Vulkan, false);
contextData->createParams->Set(NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, dc->GetFeatureFlags());
@@ -204,7 +220,7 @@ bool FeatureProvider_Vk::ChangeFeature(Upscaler upscaler, VkInstance instance, V
if (state.newBackend != Upscaler::DLSSD)
{
if (cfg.VulkanUpscaler == Upscaler::DLSS)
if (cfg.VulkanUpscaler == Upscaler::DLSS || cfg.VulkanUpscaler == Upscaler::DLSS_on12)
{
state.newBackend = Upscaler::XeSS;
ImGui::InsertNotification({ ImGuiToastType::Warning, 10000, "Falling back to XeSS" });
@@ -0,0 +1,11 @@
#include <pch.h>
#include "DLSSFeature_Dx11On12.h"
#include <upscalers/dlss/DLSSFeature_Dx12.h>
DLSSFeatureDx11On12::DLSSFeatureDx11On12(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters)
: IFeature_Dx11wDx12(InHandleId, InParameters), IFeature_Dx11(InHandleId, InParameters),
IFeature(InHandleId, InParameters)
{
dx12Feature = std::make_unique<DLSSFeatureDx12>(InHandleId, InParameters);
}
@@ -0,0 +1,10 @@
#pragma once
#include <upscalers/IFeature_Dx11wDx12.h>
class DLSSFeatureDx11On12 : public IFeature_Dx11wDx12
{
public:
Upscaler GetUpscalerType() const final { return Upscaler::DLSS_on12; }
DLSSFeatureDx11On12(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters);
};
@@ -0,0 +1,11 @@
#include <pch.h>
#include "DLSSFeature_VkOnDx12.h"
#include <upscalers/dlss/DLSSFeature_Dx12.h>
DLSSFeatureVkOnDx12::DLSSFeatureVkOnDx12(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters)
: IFeature_VkwDx12(InHandleId, InParameters), IFeature_Vk(InHandleId, InParameters),
IFeature(InHandleId, InParameters)
{
dx12Feature = std::make_unique<DLSSFeatureDx12>(InHandleId, InParameters);
}
@@ -0,0 +1,10 @@
#pragma once
#include <upscalers/IFeature_VkwDx12.h>
class DLSSFeatureVkOnDx12 : public IFeature_VkwDx12
{
public:
Upscaler GetUpscalerType() const final { return Upscaler::DLSS_on12; }
DLSSFeatureVkOnDx12(unsigned int InHandleId, NVSDK_NGX_Parameter* InParameters);
};