Skip to content

改进 DLSS NR 后处理兼容性与调节选项 - #207

Open
Raven-July wants to merge 4 commits into
IReallyWantToSleep:dlss-nrfrom
Raven-July:dlss-nr
Open

改进 DLSS NR 后处理兼容性与调节选项#207
Raven-July wants to merge 4 commits into
IReallyWantToSleep:dlss-nrfrom
Raven-July:dlss-nr

Conversation

@Raven-July

Copy link
Copy Markdown

概述

本 PR 改进了 DLSS NR 集成,主要包括 Minecraft 26.2 渲染流程适配、多 Pass 后处理、HDR 安全的颜色处理流程,以及更多 DLSS NR 调节选项。

主要改动

  • 新增 Minecraft 26.2 下 DLSS NR 后处理注入点。
  • 重构 DLSSNRPostProcessor,支持最多 4 次连续 DLSS NR 处理。
  • 为多 Pass 添加逐级递减的强度缩放,避免后续 Pass 处理过强。
  • 在尺寸变化、Pass 数变化、配置变化或功能启停时重置 DLSS NR 历史状态。
  • 增加 color、depth、motion vector 纹理尺寸检查,避免无效 dispatch。
  • 将 DLSS NR interop color texture 固定为 RGBA16F,提高 HDR / signed color 场景下的稳定性。
  • 新增 HDR / SDR 颜色转换流程:
    • HDR 输入会先压缩到可逆 AgX Log 域后再交给 DLSS NR。
    • DLSS NR 输出后再恢复到 HDR 线性颜色。
    • SDR 输入会转换为线性 FP16 工作格式。
  • 新增颜色保护与高光保护逻辑,减少 DLSS NR 导致的偏色和亮部异常。
  • 新增 native nvngx proxy DLL,用于将必要的 NGX 导出转发到 nvngx_dlssnr.dll
  • 改进 native DLSS NR 初始化流程:
    • 优先尝试 NVSDK_NGX_VULKAN_Init_with_ProjectID
    • 失败时回退到 NVSDK_NGX_VULKAN_Init_Ext2
    • 支持从 extra params 传入 app data path。
    • 改进 NGX 错误日志,输出具体 result code。
  • 将 DLSS NR DLL 加载路径调整为使用代理库 nvngx.dll
  • NativeLibManager 中注册新的 native proxy library。
  • 补充新增配置项的英文与中文翻译。

新增配置项

  • pass_count:连续执行的 DLSS NR Pass 数量,范围 1 到 4。
  • color_strength:控制 DLSS NR 对原始色度的影响强度。
  • highlight_protection:hdr模式下在高亮区域恢复原始颜色,减少亮部异常。
  • highlight_protection_threshold:hdr模式下控制高光保护开始介入的亮度阈值。
  • 现有强度相关滑条范围扩展到 0.02.0

修复内容

  • 通过 FP16 interop surface 和 HDR 色彩转换流程,修复负 RGB / 色彩不稳定问题。
  • 改善 ITRP 0.8.22 兼容性(最新支持0.8.26也正常), 增加支持26.2。
  • 改善 Minecraft 26.2 下 DLSS NR 的可用性。
  • 改善 HDR 场景下的表现,尤其是 AgX 色彩处理和高光保护。

Copilot AI lite review requested due to automatic review settings September 5, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new nvngx.dll proxy is missing a forwarded NVSDK_NGX_VULKAN_Init_with_ProjectID export and the post-process path needs an explicit GL memory barrier before blitting, plus zh_CN translations are incomplete for newly added options.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

本 PR 聚焦于改进 DLSS NR 在 Minecraft 26.2 Vulkan 渲染链路中的后处理集成:引入多 Pass 串联处理、HDR/SDR 安全的颜色工作流与更丰富的调节参数,并通过新增 nvngx.dll 代理库调整 DLSS NR 的 DLL 加载与 NGX 初始化策略。

Changes:

  • 重构 DLSS NR 后处理链路:支持最多 4 次连续 Pass,并在尺寸/配置/启停变化时重置历史。
  • 新增 HDR/SDR 颜色变换 compute shader(AgX Log 可逆域压缩/恢复 + 颜色/高光保护)。
  • 新增 NGX 代理 DLL 与初始化流程调整(更丰富的 init 路径与日志),并补充配置项与部分翻译。
File summaries
File Description
native/cpp/SRNativeDLSSNR/src/dlssnr.cpp 扩展 NGX 初始化/日志与额外参数(app data path、project id init 尝试等)
native/cpp/SRNativeDLSSNR/proxy/nvngx_proxy.cpp 新增 nvngx.dll 代理库,转发 NGX 导出到 nvngx_dlssnr.dll
native/cpp/SRNativeDLSSNR/CMakeLists.txt 构建新增的 nvngx 代理动态库目标
common/src/main/resources/super_resolution.mixins.json 注册 26.2 的 DLSS NR 注入 mixin
common/src/main/resources/shader/dlssnr_hdr_color.comp.glsl 新增 HDR/SDR 颜色压缩/恢复与保护逻辑 compute shader
common/src/main/resources/assets/super_resolution/lang/zh_cn.json 增加(部分)DLSS NR 新配置项中文文案
common/src/main/resources/assets/super_resolution/lang/en_us.json 增加 DLSS NR 新配置项英文文案
common/src/main/java/io/homo/superresolution/core/NativeLibManager.java 注册并提取新的 nvngx.dll 代理库
common/src/main/java/io/homo/superresolution/common/upscale/interoplayer/GlVulkanInteropAlgorithm.java 允许算法指定 interop color 纹理格式并传入资源初始化
common/src/main/java/io/homo/superresolution/common/upscale/algo/dlss/DLSSNR.java 固定 DLSS NR interop color 为 RGBA16F,并改用 nvngx.dll 路径/传入 app data path
common/src/main/java/io/homo/superresolution/common/presentation/DLSSNRPostProcessor.java 多 Pass DLSS NR 后处理串联、HDR/SDR 颜色工作流与历史重置策略
common/src/main/java/io/homo/superresolution/common/presentation/DLSSNRHdrColorTransform.java 新增颜色域变换与保护逻辑的 OpenGL compute 调度封装
common/src/main/java/io/homo/superresolution/common/mixin/presentation/v26_2/VulkanPresentationGameRendererDLSSNRMixin.java 26.2 渲染流程中新增 DLSS NR 后处理注入点
common/src/main/java/io/homo/superresolution/common/config/special/DLSSNRSpecialConfig.java 新增/扩展 DLSS NR 配置项与滑条范围(0..2 / Pass 数等)
Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

SuperResolutionConfig.SPECIAL.DLSSNR.HIGHLIGHT_PROTECTION.get(),
SuperResolutionConfig.SPECIAL.DLSSNR.HIGHLIGHT_PROTECTION_THRESHOLD.get()
);
Gl.DSA.blitFramebuffer(
Comment on lines +111 to +113
}

__declspec(dllexport) NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown1(VkDevice device) {
Comment on lines 252 to +256
"superresolution.screen.config.special.dlssrr.renderpreset.tooltip": "选择 NVIDIA DLSS 光线重建的渲染预设(模型)",
"superresolution.screen.config.special.dlssnr.highlight_protection.name": "DLSS NR 高光保护强度",
"superresolution.screen.config.special.dlssnr.highlight_protection.tooltip": "在明亮区域逐渐恢复未经 DLSS NR 修改的原始颜色;0 关闭,1 完全保护高光",
"superresolution.screen.config.special.dlssnr.highlight_protection_threshold.name": "DLSS NR 高光保护阈值",
"superresolution.screen.config.special.dlssnr.highlight_protection_threshold.tooltip": "控制高光保护开始介入的原始亮度;数值越低,受保护的亮部范围越大",
@RaulMARK17

Copy link
Copy Markdown

Amazing, so we will get NR in Minecraft Java hahaha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants