NIS sharpening after DLSS (VICTORY_SHARPEN, off by default, live in F1) #3689

Open
github-bot wants to merge 1 commit from github-bot/gh-3689 into main AGit
Owner

@⁠Jesper-Andersson on GitHub · 2026-11-30 04:04 UTC · original
Jesper-Andersson:t1u-sharpen-pr → main · +2176 −4 · 10 files · 1 commits · draft

Relates to: none (new feature).

What it changes

DLSS's own sharpness setting has done nothing since DLSS 2.5.1, and NVIDIA points developers to NVIDIA Image Scaling (NIS) instead (per NVIDIA, as reported by wccftech: https://wccftech.com/nvidia-dlss-2-5-1-disables-built-in-sharpening-nvidia-tells-developers-to-use-nis-going-forward/). This adds an optional sharpening pass for DLSS output.

  • VICTORY_SHARPEN=0..1 (a float, default 0 = off, nothing is recorded: one atomic load). It runs NIS NVSharpen (sharpening only, NIS_SCALER=0, same size in and out) on the texture DLSS just wrote. The pass is recorded in the title's list right after the DLSS evaluation, so it comes before the title's tone mapping, its interface plane and our compose, and before frame generation tags its inputs. Nothing happens without DLSS.
  • The output is copied into a same-size texture of ours (remade on a size or format change, kept alive by the lists that used it). NVSharpen reads the copy and writes the output, which ends in the unordered-access state DLSS left it in.
  • Live in F1: item "SHARPEN (NIS)", OFF / 0.2 / 0.35 / 0.5 / 0.7 / 1.0. A VICTORY_HOT_AB file overrides it.
  • The DLSS output here is linear HDR (R16G16B16A16_FLOAT), not the display-referred colour NIS asks for. Float outputs use NIS's HDR linear mode, UNORM ones the SDR mode. VICTORY_SHARPEN_HDR=0/1 forces one of them. Tone mapping is unchanged.
  • The shaders are the NVIDIA Image Scaling SDK v1.0.3 ones, unchanged, under MIT (crates/victory-gpu/src/sharpen/, with the LICENSE and the provenance, SDK commit named). NIS_Scaler.h is renamed NIS_Scaler.hlsli because the repository policy allows no .h files. NVSharpenUpdateConfig is ported to Rust. They are compiled at run time through hlsl.rs (D3DCompile cs_5_1, DXC fallback) on a thread of its own at the first need; until then upscalings are not sharpened.
  • Docs: docs/dlss.md (switch table) and docs/findings.md.

Credit: NVIDIA Image Scaling SDK (MIT, https://github.com/NVIDIAGameWorks/NVIDIAImageScaling).

Not in this PR: any change to tone mapping, FSR/XeSS paths, or DLSS's own sharpness parameter.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 2070 SUPER 8 GB (driver 621.40), Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 26320, Series S, DLSS Performance (render 960x540 to 1920x1080, preset K), FSR3 frame generation 2x, VICTORY_SHARPEN=0.5. This ran in a local build that has the same commit merged with other work, not on a clean build of this branch. The log shows the shader compiled with D3DCompile cs_5_1 in 1002 ms (11,736 bytes, mode "HDR linear"), a copy texture of 1920x1080 format 10, and "first upscaling sharpened strength=0.5".
  • Before: no sharpening (default).
  • After: in a single short in-game session the author's verdict was "50% sharpness looks good so far". Subjective only: no A/B and no screenshot comparison. docs/findings.md was written before that session and lists what is still unmeasured.
  • Not measured: GPU cost (estimate 0.1 to 0.3 ms and 16 MB of VRAM at 1080p, an estimate only), frame generation artefacts with sharpened input, other GPUs including AMD, Series X, 1440p and 4K. How strong a value looks after the title's tone map is also unmeasured, since it runs on linear HDR before it.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): not tested for wave size. Only a Turing card (32 lanes) was used; the NIS compute shader is used as shipped.
  • cargo test passed for the crates it touches: yes. cargo check -p victory clean; cargo test -p victory-gpu --lib sharpen: 9 passed, 0 failed; cargo test -p victory-gpu --lib menu -- --test-threads=1: 15 passed, 0 failed. No new clippy lints in the files touched. Tests that need the GPU were not run.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Searches in this repository for "sharpen", "NIS" and "CAS" (issues and PRs) found no sharpening work. Hits were unrelated: #1759 (texture pool), #3104 (descriptor queue), #181 (shadow buffers). Related: none found.
  • Policy: cargo xtask policy is clean for the files in this PR. A plain full-tree run still flags the existing crates/victory-loader/src/heap_sites/frame_users.rs (a long run of hex digits), which this PR does not touch.

This change was made with AI assistance (Claude Code).

**@⁠Jesper-Andersson** on GitHub · 2026-11-30 04:04 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3689) `Jesper-Andersson:t1u-sharpen-pr` → `main` · +2176 −4 · 10 files · 1 commits · draft <!-- Thanks for the pull request. Please label it (pr-fix, pr-feature, pr-performance, pr-diagnostics, pr-refactor, pr-docs or pr-tests, plus the area labels), or put the label in the title, like [pr-feature]. --> Relates to: none (new feature). ## What it changes DLSS's own sharpness setting has done nothing since DLSS 2.5.1, and NVIDIA points developers to NVIDIA Image Scaling (NIS) instead (per NVIDIA, as reported by wccftech: https://wccftech.com/nvidia-dlss-2-5-1-disables-built-in-sharpening-nvidia-tells-developers-to-use-nis-going-forward/). This adds an optional sharpening pass for DLSS output. - `VICTORY_SHARPEN=0..1` (a float, default 0 = off, nothing is recorded: one atomic load). It runs NIS NVSharpen (sharpening only, `NIS_SCALER=0`, same size in and out) on the texture DLSS just wrote. The pass is recorded in the title's list right after the DLSS evaluation, so it comes before the title's tone mapping, its interface plane and our compose, and before frame generation tags its inputs. Nothing happens without DLSS. - The output is copied into a same-size texture of ours (remade on a size or format change, kept alive by the lists that used it). NVSharpen reads the copy and writes the output, which ends in the unordered-access state DLSS left it in. - Live in F1: item "SHARPEN (NIS)", OFF / 0.2 / 0.35 / 0.5 / 0.7 / 1.0. A `VICTORY_HOT_AB` file overrides it. - The DLSS output here is linear HDR (R16G16B16A16_FLOAT), not the display-referred colour NIS asks for. Float outputs use NIS's HDR linear mode, UNORM ones the SDR mode. `VICTORY_SHARPEN_HDR=0/1` forces one of them. Tone mapping is unchanged. - The shaders are the NVIDIA Image Scaling SDK v1.0.3 ones, unchanged, under MIT (`crates/victory-gpu/src/sharpen/`, with the LICENSE and the provenance, SDK commit named). `NIS_Scaler.h` is renamed `NIS_Scaler.hlsli` because the repository policy allows no `.h` files. `NVSharpenUpdateConfig` is ported to Rust. They are compiled at run time through `hlsl.rs` (D3DCompile `cs_5_1`, DXC fallback) on a thread of its own at the first need; until then upscalings are not sharpened. - Docs: `docs/dlss.md` (switch table) and `docs/findings.md`. Credit: NVIDIA Image Scaling SDK (MIT, https://github.com/NVIDIAGameWorks/NVIDIAImageScaling). Not in this PR: any change to tone mapping, FSR/XeSS paths, or DLSS's own sharpness parameter. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 2070 SUPER 8 GB (driver 621.40), Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 26320, Series S, DLSS Performance (render 960x540 to 1920x1080, preset K), FSR3 frame generation 2x, `VICTORY_SHARPEN=0.5`. This ran in a local build that has the same commit merged with other work, not on a clean build of this branch. The log shows the shader compiled with D3DCompile `cs_5_1` in 1002 ms (11,736 bytes, mode "HDR linear"), a copy texture of 1920x1080 format 10, and "first upscaling sharpened strength=0.5". - Before: no sharpening (default). - After: in a single short in-game session the author's verdict was "50% sharpness looks good so far". Subjective only: no A/B and no screenshot comparison. `docs/findings.md` was written before that session and lists what is still unmeasured. - Not measured: GPU cost (estimate 0.1 to 0.3 ms and 16 MB of VRAM at 1080p, an estimate only), frame generation artefacts with sharpened input, other GPUs including AMD, Series X, 1440p and 4K. How strong a value looks after the title's tone map is also unmeasured, since it runs on linear HDR before it. - For shader changes, the wave sizes tested (32 and/or 64 lanes): not tested for wave size. Only a Turing card (32 lanes) was used; the NIS compute shader is used as shipped. - `cargo test` passed for the crates it touches: yes. `cargo check -p victory` clean; `cargo test -p victory-gpu --lib sharpen`: 9 passed, 0 failed; `cargo test -p victory-gpu --lib menu -- --test-threads=1`: 15 passed, 0 failed. No new clippy lints in the files touched. Tests that need the GPU were not run. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Searches in this repository for "sharpen", "NIS" and "CAS" (issues and PRs) found no sharpening work. Hits were unrelated: #1759 (texture pool), #3104 (descriptor queue), #181 (shadow buffers). Related: none found. - Policy: `cargo xtask policy` is clean for the files in this PR. A plain full-tree run still flags the existing `crates/victory-loader/src/heap_sites/frame_users.rs` (a long run of hex digits), which this PR does not touch. This change was made with AI assistance (Claude Code).
DLSS's own sharpness has done nothing since DLSS 2.5.1; NVIDIA points to NVIDIA Image
Scaling. VICTORY_SHARPEN runs NIS NVSharpen (sharpening only, NIS_SCALER=0, same size in
and out) on the texture DLSS just wrote, recorded in the title's list right after the DLSS
evaluation: before the title's tone mapping, its interface plane and our compose, and
before frame generation tags its inputs at the present. The output is copied into a
same-size texture of ours (remade on a size or format change, kept alive by the lists that
used it), NVSharpen reads the copy and writes the output, which ends in the unordered
access state DLSS left it in. 0 or unset: nothing is recorded (one atomic load). Nothing
without DLSS.

The shaders are the NIS SDK v1.0.3 ones, unchanged and under MIT (crates/victory-gpu/src/
sharpen/, with LICENSE; NIS_Scaler.h is renamed .hlsli for the repository policy);
NVSharpenUpdateConfig is ported to Rust. Compiled at run time through hlsl.rs (D3DCompile
cs_5_1, DXC fallback) on a thread of its own at the first need, logged with the compiler
and the time; until then upscalings are not sharpened.

The DLSS output here is linear HDR (R16G16B16A16_FLOAT, hdr=true), not the display-referred
colour NIS asks for: float outputs use NIS's HDR linear mode, UNORM ones the SDR mode
(VICTORY_SHARPEN_HDR=0/1 forces one). Tone mapping is unchanged; how strong a value looks
after the title's tone map, the cost and frame generation with sharpened input are not
measured.

F1: SHARPEN (NIS), OFF/0.2/0.35/0.5/0.7/1.0, live; a VICTORY_HOT_AB file overrides it.

This change was made with AI assistance (Claude Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 04:05:33 +00:00
github-bot force-pushed github-bot/gh-3689 from cfb62dd6a4 to 522e7cd2df 2026-12-01 04:42:46 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/menu.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3689/head:github-bot/gh-3689'
git switch 'github-bot/gh-3689'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3689'
git switch 'github-bot/gh-3689'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3689'
git switch 'github-bot/gh-3689'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3689'
git switch 'main'
git merge --squash 'github-bot/gh-3689'
git switch 'main'
git merge --ff-only 'github-bot/gh-3689'
git switch 'main'
git merge 'github-bot/gh-3689'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3689
No description provided.