Skip to content

Commit 158dc61

Browse files
committed
Merge branch 'pkristof/rr4.5' into 'main'
[REMIX-5655, REMIX-5656] Updated DLSS SR & RR to 4.5 (310.7.128) See merge request lightspeedrtx/dxvk-remix-nv!2197
2 parents 574be6b + 7294f68 commit 158dc61

12 files changed

Lines changed: 116 additions & 46 deletions

RtxOptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ This file is auto-generated by RTX Remix. To regenerate it, run Remix with `DXVK
175175
|rtx.dlfg.enable|bool|True|||Enables DLSS 3\.0 frame generation which generates interpolated frames to increase framerate at the cost of slightly more latency\.|
176176
|rtx.dlfg.enablePresentMetering|bool|True|||Use hardware present metering for DLSS 4\.0 frame generation instead of CPU pacing\.|
177177
|rtx.dlfg.maxInterpolatedFrames|int|2|1|6|For DLSS 4\.5 frame generation, controls the number of interpolated frames for each rendered frame\. Ignored for DLSS 3\.0\.|
178+
|rtx.dlss.preset|int|0|||Render preset for DLSS Super Resolution\. Default = 0 \(DLSS picks the best preset\), J = 10, K = 11, L = 12, M = 13\.|
178179
|rtx.dlssEnhancementDirectLightMaxValue|float|10|||The maximum strength of direct lighting enhancement\.|
179180
|rtx.dlssEnhancementDirectLightPower|float|0.7|||The overall strength of direct lighting enhancement\.|
180181
|rtx.dlssEnhancementIndirectLightMaxValue|float|1.5|||The maximum strength of indirect lighting enhancement\.|
@@ -618,13 +619,12 @@ This file is auto-generated by RTX Remix. To regenerate it, run Remix with `DXVK
618619
|rtx.rayreconstruction.enableDetailEnhancement|bool|True|||Enable detail enhancement filter to enhance normal map details\.<br>|
619620
|rtx.rayreconstruction.enableDisocclusionMaskBlur|bool|False|||Enables blurring of disocclusion mask to suppress instabilities due to abrupt mask value changes\.|
620621
|rtx.rayreconstruction.enableNRDForTraining|bool|False|||Enable NRD\. This option is only for training or debug purpose\.<br>|
621-
|rtx.rayreconstruction.enableTransformerModelD|bool|False||||
622622
|rtx.rayreconstruction.invalidateHistoryForAnimatedWater|bool|False|||Adds animated water surfaces to the disocclusion mask, making DLSS Ray Reconstruction discard their temporal history every frame\.<br>This suppresses ghosting from the water's per\-frame normal variation, but can introduce shimmering on objects seen through or near the water, so it is disabled by default\.<br>Enable it for content whose animated water ghosts noticeably\.|
623-
|rtx.rayreconstruction.model|int|1|||Ray reconstruction model to use\. 0: CNN, 1: Transformer \(higher quality\)\.|
624623
|rtx.rayreconstruction.particleBufferMode|int|1|||Use a separate particle buffer to handle particles\.<br>|
625624
|rtx.rayreconstruction.pathTracerPreset|int|1|||Path tracer preset to use when Ray Reconstruction is enabled\.|
626625
|rtx.rayreconstruction.preprocessSecondarySignal|bool|True|||Denoise secondary signal before passing to DLSS\-RR\. This option improves reflection on translucent objects\.<br>|
627626
|rtx.rayreconstruction.preserveSettingsInNativeMode|bool|False|||Preserve settings when switched to native mode, otherwise the default preset will be applied\.<br>|
627+
|rtx.rayreconstruction.preset|int|0|||Render preset for Ray Reconstruction\. Default = 0 \(DLSS picks the best preset\), D = 4, E = 5, F = 6\.|
628628
|rtx.rayreconstruction.upscalerRoughnessDemodulationMultiplier|float|0.15|||Multiplier of upscaler roughness demodulation to suppress noise\. Only used by DLSS\-RR\.|
629629
|rtx.rayreconstruction.upscalerRoughnessDemodulationOffset|float|1.5|||Strength of upscaler roughness demodulation\. Only used by DLSS\-RR\.|
630630
|rtx.rayreconstruction.useSpecularHitDistance|bool|True|||Use specular hit distance to reduce ghosting\.<br>|

packman-external.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<package name="rtx-remix-ngx_sdk_dlfg" version="4" />
3434
</dependency>
3535
<dependency name="ngx_sdk_dldn" linkPath="external/ngx_sdk_dldn">
36-
<package name="rtx-remix-ngx_sdk_dldn" version="5" />
36+
<package name="rtx-remix-ngx_sdk_dldn" version="7" />
3737
</dependency>
3838
<dependency name="nrd" linkPath="external/nrd">
3939
<package name="rtx-remix-nrd" version="4.13" />

src/dxvk/imgui/dxvk_imgui.cpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,19 @@ namespace dxvk {
311311
} }
312312
};
313313

314+
// Note: named 'dlssRenderPresetCombo' to avoid colliding with the user-menu 'dlssPresetCombo'
315+
// (the combined On/Off/Custom preset).
316+
RemixGui::ComboWithKey<DxvkDLSS::DLSSPreset> dlssRenderPresetCombo{
317+
"DLSS SR Preset",
318+
RemixGui::ComboWithKey<DxvkDLSS::DLSSPreset>::ComboEntries{ {
319+
{DxvkDLSS::DLSSPreset::Default, "Default", "Let DLSS pick the best preset per quality mode."},
320+
{DxvkDLSS::DLSSPreset::J, "J", "Similar to preset K, but may show slightly less ghosting at the cost of extra flickering. Preset K is generally recommended over J."},
321+
{DxvkDLSS::DLSSPreset::K, "K", "Transformer-based default for DLAA/Balanced/Quality modes. Best image quality at a higher performance cost."},
322+
{DxvkDLSS::DLSSPreset::L, "L", "Default for Ultra Performance mode."},
323+
{DxvkDLSS::DLSSPreset::M, "M", "Default for Performance mode."},
324+
} }
325+
};
326+
314327
RemixGui::ComboWithKey<XeSSPreset> xessPresetCombo{
315328
"XeSS Preset",
316329
RemixGui::ComboWithKey<XeSSPreset>::ComboEntries{ {
@@ -349,12 +362,15 @@ namespace dxvk {
349362
} }
350363
};
351364

352-
static auto rayReconstructionModelCombo = RemixGui::ComboWithKey<DxvkRayReconstruction::RayReconstructionModel>(
353-
"Ray Reconstruction Model",
365+
RemixGui::ComboWithKey<DxvkRayReconstruction::RayReconstructionPreset> rayReconstructionPresetCombo {
366+
"DLSS RR Preset",
354367
{ {
355-
{DxvkRayReconstruction::RayReconstructionModel::Transformer, "Transformer", "Ensures highest image quality. Can be more expensive than CNN in terms of memory and performance."},
356-
{DxvkRayReconstruction::RayReconstructionModel::CNN, "CNN", "Ensures great image quality"},
357-
} });
368+
{ DxvkRayReconstruction::RayReconstructionPreset::Default, "Default", "Let DLSS pick the best preset per quality mode." },
369+
{ DxvkRayReconstruction::RayReconstructionPreset::D, "D", "Transformer model." },
370+
{ DxvkRayReconstruction::RayReconstructionPreset::E, "E", "Latest transformer model." },
371+
{ DxvkRayReconstruction::RayReconstructionPreset::F, "F", "Default RR2 model." },
372+
} }
373+
};
358374

359375
RemixGui::ComboWithKey<int> dlfgMfgModeCombo {
360376
"DLSS Frame Generation Mode",
@@ -517,7 +533,7 @@ namespace dxvk {
517533
changed = RemixGui::Checkbox("Ray Reconstruction", &RtxOptions::enableRayReconstructionObject());
518534

519535
if (RtxOptions::enableRayReconstruction()) {
520-
rayReconstructionModelCombo.getKey(&DxvkRayReconstruction::modelObject());
536+
rayReconstructionPresetCombo.getKey(&DxvkRayReconstruction::presetObject());
521537
}
522538
ImGui::EndDisabled();
523539
}
@@ -3541,6 +3557,7 @@ namespace dxvk {
35413557
dlssProfileCombo.getKey(&RtxOptions::qualityDLSSObject());
35423558
rayReconstruction.showRayReconstructionImguiSettings(false);
35433559
} else if (RtxOptions::upscalerType() == UpscalerType::DLSS) {
3560+
dlssRenderPresetCombo.getKey(&DxvkDLSS::presetObject());
35443561
dlssProfileCombo.getKey(&RtxOptions::qualityDLSSObject());
35453562
dlss.showImguiSettings();
35463563
} else if (RtxOptions::upscalerType() == UpscalerType::NIS) {

src/dxvk/imgui/rtx_user_menu.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ namespace dxvk {
5050

5151
// Combo boxes shared with dxvk_imgui.cpp
5252
extern RemixGui::ComboWithKey<DLSSProfile> dlssProfileCombo;
53+
extern RemixGui::ComboWithKey<DxvkDLSS::DLSSPreset> dlssRenderPresetCombo;
5354
extern RemixGui::ComboWithKey<XeSSPreset> xessPresetCombo;
5455

5556
// Combo boxes used only by the user menu
@@ -405,6 +406,12 @@ namespace dxvk {
405406

406407
switch (RtxOptions::upscalerType()) {
407408
case UpscalerType::DLSS: {
409+
// Preset is shown before the mode. Ray Reconstruction has its own preset selector
410+
// (rendered by showRayReconstructionEnable above), so only show the SR preset here.
411+
if (!RtxOptions::enableRayReconstruction()) {
412+
dlssRenderPresetCombo.getKey(&DxvkDLSS::presetObject());
413+
}
414+
408415
dlssProfileCombo.getKey(&RtxOptions::qualityDLSSObject());
409416

410417
// Display DLSS Upscaling Information

src/dxvk/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ nrd_dep = declare_dependency(
445445
include_directories : nrd_include_dir
446446
)
447447

448-
target_dlss_lib_path = 'lib/Windows_x86_64/x86_64'
448+
target_dlss_lib_path = 'lib/Windows_x86_64/x64'
449449
if dxvk_is_woa
450450
target_dlss_lib_path = 'lib/Windows_arm64/arm64'
451451
endif

src/dxvk/rtx_render/rtx_dlss.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ namespace dxvk {
201201
ctx->setFramePassStage(RtxFramePassStage::DLSS);
202202

203203
bool dlssAutoExposure = useDlssAutoExposure();
204-
mRecreate |= (mAutoExposure != dlssAutoExposure);
204+
mRecreate |= (mAutoExposure != dlssAutoExposure)
205+
|| m_prevPreset != preset();
205206
mAutoExposure = dlssAutoExposure;
207+
m_prevPreset = preset();
206208

207209
if (mRecreate) {
208210
initializeDLSS(ctx);
@@ -337,6 +339,21 @@ namespace dxvk {
337339
// required for initializing DLSS.
338340
const NVSDK_NGX_PerfQuality_Value perfQuality = profileToQuality(mActualProfile);
339341

340-
m_dlssContext->initialize(renderContext, mInputSize, mDLSSOutputSize, mIsHDR, mInverseDepth, mAutoExposure, false, perfQuality);
342+
// DLSSPreset enum values match the NGX preset enum, so a direct cast is valid.
343+
// Fall back to the default preset for any unexpected/out-of-range value.
344+
NVSDK_NGX_DLSS_Hint_Render_Preset dlssPreset;
345+
switch (preset()) {
346+
case DLSSPreset::J:
347+
case DLSSPreset::K:
348+
case DLSSPreset::L:
349+
case DLSSPreset::M:
350+
dlssPreset = static_cast<NVSDK_NGX_DLSS_Hint_Render_Preset>(preset());
351+
break;
352+
default:
353+
dlssPreset = NVSDK_NGX_DLSS_Hint_Render_Preset_Default;
354+
break;
355+
}
356+
357+
m_dlssContext->initialize(renderContext, mInputSize, mDLSSOutputSize, mIsHDR, mInverseDepth, mAutoExposure, false, dlssPreset, perfQuality);
341358
}
342359
}

src/dxvk/rtx_render/rtx_dlss.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved.
2+
* Copyright (c) 2023-2026, NVIDIA CORPORATION. All rights reserved.
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining a
55
* copy of this software and associated documentation files (the "Software"),
@@ -63,6 +63,17 @@ namespace dxvk {
6363
Relative, ///< Motion vectors are provided in relative screen space length (pixels divided by screen width/height).
6464
};
6565

66+
// Note: Values must match NVSDK_NGX_DLSS_Hint_Render_Preset in nvsdk_ngx_defs.h.
67+
// Presets A/B/C/D were removed in the SDK, E/F are deprecated, and G/H/I/N/O are unused,
68+
// so only the valid presets are exposed here. Default lets DLSS pick the best preset per quality mode.
69+
enum class DLSSPreset : uint32_t {
70+
Default = 0,
71+
J = 10,
72+
K = 11,
73+
L = 12,
74+
M = 13,
75+
};
76+
6677
explicit DxvkDLSS(DxvkDevice* device);
6778
~DxvkDLSS();
6879
static NVSDK_NGX_PerfQuality_Value profileToQuality(DLSSProfile profile);
@@ -90,6 +101,10 @@ namespace dxvk {
90101

91102
void release();
92103

104+
RTX_OPTION_ARGS("rtx.dlss", DLSSPreset, preset, DLSSPreset::Default,
105+
"Render preset for DLSS Super Resolution. Default = 0 (DLSS picks the best preset), J = 10, K = 11, L = 12, M = 13.",
106+
args.flags = RtxOptionFlags::UserSetting);
107+
93108
protected:
94109
virtual bool isEnabled() const override;
95110

@@ -109,6 +124,7 @@ namespace dxvk {
109124
bool mInverseDepth = false;
110125

111126
bool mRecreate = true;
127+
DLSSPreset m_prevPreset = DLSSPreset::Default;
112128
uint32_t mInputSize[2] = {}; ///< Input size in pixels.
113129
uint32_t mDLSSOutputSize[2] = {}; ///< DLSS output size in pixels.
114130

src/dxvk/rtx_render/rtx_ngx_wrapper.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ namespace dxvk
447447
bool depthInverted,
448448
bool autoExposure,
449449
bool sharpening,
450+
NVSDK_NGX_DLSS_Hint_Render_Preset dlssPreset,
450451
NVSDK_NGX_PerfQuality_Value perfQuality) {
451452
ScopedCpuProfileZone();
452453

@@ -475,6 +476,12 @@ namespace dxvk
475476

476477
VkCommandBuffer vkCommandBuffer = renderContext->getCommandList()->getCmdBuffer(dxvk::DxvkCmdBuffer::ExecBuffer);
477478

479+
m_parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_DLAA, dlssPreset);
480+
m_parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_Quality, dlssPreset);
481+
m_parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_Balanced, dlssPreset);
482+
m_parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_Performance, dlssPreset);
483+
m_parameters->Set(NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_UltraPerformance, dlssPreset);
484+
478485
// Release video memory when DLSS is disabled.
479486
m_parameters->Set(NVSDK_NGX_Parameter_FreeMemOnReleaseFeature, 1);
480487

src/dxvk/rtx_render/rtx_ngx_wrapper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ namespace dxvk {
182182
bool depthInverted,
183183
bool autoExposure,
184184
bool sharpening,
185+
NVSDK_NGX_DLSS_Hint_Render_Preset dlssPreset,
185186
NVSDK_NGX_PerfQuality_Value perfQuality = NVSDK_NGX_PerfQuality_Value_MaxPerf);
186187

187188
/** Release DLSS.

src/dxvk/rtx_render/rtx_options.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ namespace dxvk {
539539
volumetrics.setQualityLevel(RtxGlobalVolumetrics::Ultra);
540540
enableNrcPreset(NeuralRadianceCache::QualityPreset::Ultra);
541541

542-
DxvkRayReconstruction::model.setDeferred(DxvkRayReconstruction::RayReconstructionModel::Transformer);
543542
} else if (graphicsPreset() == GraphicsPreset::High) {
544543
pathMinBounces.setDeferred(0);
545544
pathMaxBounces.setDeferred(2);
@@ -561,7 +560,6 @@ namespace dxvk {
561560
volumetrics.setQualityLevel(RtxGlobalVolumetrics::High);
562561
enableNrcPreset(NeuralRadianceCache::QualityPreset::High);
563562

564-
DxvkRayReconstruction::model.setDeferred(DxvkRayReconstruction::RayReconstructionModel::Transformer);
565563
} else if (graphicsPreset() == GraphicsPreset::Medium) {
566564
lowGraphicsPresetCommonSettings();
567565

@@ -570,8 +568,6 @@ namespace dxvk {
570568

571569
volumetrics.setQualityLevel(RtxGlobalVolumetrics::Medium);
572570
enableNrcPreset(NeuralRadianceCache::QualityPreset::Medium);
573-
574-
DxvkRayReconstruction::model.setDeferred(DxvkRayReconstruction::RayReconstructionModel::CNN);
575571
} else if (graphicsPreset() == GraphicsPreset::Low) {
576572
lowGraphicsPresetCommonSettings();
577573

@@ -580,8 +576,7 @@ namespace dxvk {
580576

581577
volumetrics.setQualityLevel(RtxGlobalVolumetrics::Low);
582578
enableNrcPreset(NeuralRadianceCache::QualityPreset::Medium);
583-
584-
DxvkRayReconstruction::model.setDeferred(DxvkRayReconstruction::RayReconstructionModel::CNN);
579+
585580
}
586581

587582
// Ensure we are using auto DLSS profile since we will be relying on quality downgrades for Medium/Low settings

0 commit comments

Comments
 (0)