GPU: the ambient depth table bound by the resolve only, and frame generation asked again when DLSS-G allows more frames #3065

Open
github-bot wants to merge 4 commits from github-bot/gh-3065 into main AGit
Owner

@⁠Adriwin06 on GitHub · 2026-11-29 19:52 UTC · original
Adriwin06:gpu-fixes → main · +126 −6 · 2 files · 4 commits · open

What it changes

2 small changes of the same kind, one commit each, so each can be reviewed, reverted or left out on its own:

Ambient: only the resolve pass binds the depth table

Every ambient role set root table 1 to the depth view. The radiance and
air roles have only an image UAV there, which is not a valid descriptor
for that SRV range even when their shaders leave the range unused. Only the resolve role, the one that reads
depth, binds it now.

Ported from DoubleGhosty/cool_fox@3ba9541 (Xyzstk), GPL-3.0-or-later.

Streamline: frame generation is asked again once DLSS-G reports more frames possible

The number of frames to generate is set from what slDLSSGGetState
reported before the first generated frame. When a later state reports a
higher num_frames_to_generate_max while fewer frames than wanted are
being generated (the multiplier came out lower than asked), the options
are now applied once more, so the asked multiplier takes effect instead
of staying at the early, lower maximum.

Ported from readmet3xt-lab/foxhound@4349ab5, GPL-3.0-or-later.

How it was tested

  • GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch.
  • Before: n/a (no in-title measurement on this branch)
  • After: n/a
  • cargo test passed for the crates it touches:
    • ambient-resolve-depth: yes, cargo test -p victory-gpu --lib -- ambient::: 14 passed
    • fg-raise: yes, cargo test -p victory-gpu --lib -- streamline::: 53 passed
  • cargo clippy --workspace --all-targets --locked: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself).
  • cargo xtask policy: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs).
  • With all eleven of my pull requests merged together: cargo clippy also with --all-features adds no finding, and cargo test --workspace --locked fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related:
    • ambient-resolve-depth: #2 (merged) fixed error 646 in the ambient depth binding; the radiance and air roles still bound the depth table after it.
    • fg-raise: #1271 (merged) sizes the swap chain for 3X-6X; none found for re-applying the options after a later, higher maximum.

🤖 Generated with Claude Code

**@⁠Adriwin06** on GitHub · 2026-11-29 19:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3065) `Adriwin06:gpu-fixes` → `main` · +126 −6 · 2 files · 4 commits · open ## What it changes 2 small changes of the same kind, one commit each, so each can be reviewed, reverted or left out on its own: ### Ambient: only the resolve pass binds the depth table Every ambient role set root table 1 to the depth view. The radiance and air roles have only an image UAV there, which is not a valid descriptor for that SRV range even when their shaders leave the range unused. Only the resolve role, the one that reads depth, binds it now. Ported from DoubleGhosty/cool_fox@3ba9541 (Xyzstk), GPL-3.0-or-later. ### Streamline: frame generation is asked again once DLSS-G reports more frames possible The number of frames to generate is set from what slDLSSGGetState reported before the first generated frame. When a later state reports a higher num_frames_to_generate_max while fewer frames than wanted are being generated (the multiplier came out lower than asked), the options are now applied once more, so the asked multiplier takes effect instead of staying at the early, lower maximum. Ported from readmet3xt-lab/foxhound@4349ab5, GPL-3.0-or-later. ## How it was tested - GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch. - Before: n/a (no in-title measurement on this branch) - After: n/a - `cargo test` passed for the crates it touches: - ambient-resolve-depth: yes, `cargo test -p victory-gpu --lib -- ambient::`: 14 passed - fg-raise: yes, `cargo test -p victory-gpu --lib -- streamline::`: 53 passed - `cargo clippy --workspace --all-targets --locked`: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself). - `cargo xtask policy`: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs). - With all eleven of my pull requests merged together: `cargo clippy` also with `--all-features` adds no finding, and `cargo test --workspace --locked` fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: - ambient-resolve-depth: #2 (merged) fixed error 646 in the ambient depth binding; the radiance and air roles still bound the depth table after it. - fg-raise: #1271 (merged) sizes the swap chain for 3X-6X; none found for re-applying the options after a later, higher maximum. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Every ambient role set root table 1 to the depth view. The radiance and
air roles have only an image UAV there, which is not a valid descriptor
for that SRV range even when their shaders leave the range unused. Only the resolve role, the one that reads
depth, binds it now.

Ported from DoubleGhosty/cool_fox@3ba9541 (Xyzstk), GPL-3.0-or-later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The number of frames to generate is set from what slDLSSGGetState
reported before the first generated frame. When a later state reports a
higher num_frames_to_generate_max while fewer frames than wanted are
being generated (the multiplier came out lower than asked), the options
are now applied once more, so the asked multiplier takes effect instead
of staying at the early, lower maximum.

Ported from readmet3xt-lab/foxhound@4349ab5, GPL-3.0-or-later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 19:53:19 +00:00
github-bot changed title from [pr-fix] GPU: the ambient depth table bound by the resolve only, and frame generation asked again when DLSS-G allows more frames to GPU: the ambient depth table bound by the resolve only, and frame generation asked again when DLSS-G allows more frames 2026-11-29 20:00:18 +00:00
@ -1160,0 +1159,4 @@
// Only the resolve reads depth. The radiance and air roles have
// only an image UAV, which is not a valid descriptor for this SRV
// range even when their shaders leave the range unused.
if role == Role::Resolve {
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:56 UTC · original

Role::Miss also reads depth: its place, gather, and reflection shaders call seen(), which loads the depth texture. This condition leaves those dispatches without their required depth table, breaking the specular stand-in and potentially triggering D3D12 validation errors. Bind depth for both Resolve and Miss; only Radiance and Air should skip it.

**@⁠Copilot** on GitHub · 2026-11-29 19:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3065#discussion_r4732923475) `Role::Miss` also reads depth: its `place`, `gather`, and reflection shaders call `seen()`, which loads the depth texture. This condition leaves those dispatches without their required depth table, breaking the specular stand-in and potentially triggering D3D12 validation errors. Bind depth for both Resolve and Miss; only Radiance and Air should skip it.
@ -2582,3 +2582,3 @@
let on = on && wanted != 0;
let times = if on { wanted } else { 0 };
if on != calls.framegen_on || times != calls.framegen_times {
let raise = on && calls.framegen_on && FG_RAISE.swap(false, Relaxed);
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:56 UTC · original

If slDLSSGSetOptions rejects a raise from 2X to the requested 6X, this swap has already cleared the retry flag and FG_TIMES advances to 6 despite the failure. The cached request is unchanged and the post-present check sees no shortfall, so generation can remain at 2X without another attempt. Restore the pending raise on failure and update FG_TIMES only when options are accepted, including the accepted out-of-VRAM warning.

**@⁠Copilot** on GitHub · 2026-11-29 19:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3065#discussion_r4732923490) If `slDLSSGSetOptions` rejects a raise from 2X to the requested 6X, this swap has already cleared the retry flag and `FG_TIMES` advances to 6 despite the failure. The cached request is unchanged and the post-present check sees no shortfall, so generation can remain at 2X without another attempt. Restore the pending raise on failure and update `FG_TIMES` only when options are accepted, including the accepted out-of-VRAM warning.
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-29 19:56 UTC · original · reviewed

Miss dispatches lack required depth bindings, risking broken specular rendering and D3D12 validation errors, while rejected frame-generation increases can clear retries and incorrectly advance the recorded multiplier.

2 open issues
What changed in this PR

This PR adjusts the GPU backend’s ambient depth binding and DLSS frame-generation recovery, following the earlier descriptor and multi-frame-generation fixes.

Changes:

  • Restricts ambient depth-table binding to the resolve role, avoiding invalid bindings in Radiance and Air.
  • Reapplies frame-generation options when DLSS-G reports capacity above the currently configured multiplier.
File Description
crates/​victory-gpu/​src/​streamline.rs Adds a pending flag to retry options when frame-generation capacity increases.
crates/​victory-gpu/​src/​ambient.rs Makes depth-table binding conditional on the ambient pass role.

Review effort: Balanced

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-29 19:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3065#pullrequestreview-6104533742) · **reviewed** <!-- ccr-overview-v2 --> ### 🟡 Changes recommended Miss dispatches lack required depth bindings, risking broken specular rendering and D3D12 validation errors, while rejected frame-generation increases can clear retries and incorrectly advance the recorded multiplier. <details open> <summary><strong>2 open issues</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [Bind depth for Miss-role shader dispatches](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3065) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Preserve frame-generation retry state when option updates fail](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3065) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> This PR adjusts the GPU backend’s ambient depth binding and DLSS frame-generation recovery, following the earlier descriptor and multi-frame-generation fixes. **Changes:** - Restricts ambient depth-table binding to the resolve role, avoiding invalid bindings in Radiance and Air. - Reapplies frame-generation options when DLSS-G reports capacity above the currently configured multiplier. | File | Description | | ---- | ----------- | | `crates/​victory-gpu/​src/​streamline.rs` | Adds a pending flag to retry options when frame-generation capacity increases. | | `crates/​victory-gpu/​src/​ambient.rs` | Makes depth-table binding conditional on the ambient pass role. | </details> <sub>Review effort: Balanced</sub>
Its place, gather and reflect passes call seen(), which reads the depth
at t0, but after() bound the depth table for the resolve only, so those
three dispatches read a root table left unset (setting the root
signature unsets every argument): an undefined descriptor for the
specular stand-in, and a D3D12 validation error. Both the resolve and
the miss now bind it (reads_depth); the radiance and the air still do
not, since the one view they have is an image UAV. Test:
the_roles_given_depth_are_those_whose_passes_read_it checks each role's
passes in the shader source for seen().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
FG_TIMES was stored before the call whatever it returned, and the retry
flag (FG_RAISE) had been taken off by then. A raise from 2X to 6X the
driver refused therefore left 6 recorded: the state after the present
showed no shortfall, and generation stayed at 2X with nothing to ask it
again. Now FG_TIMES changes only when the options are taken (0, or 39
"out of VRAM", with which they are set all the same), and a refused
raise is owed again at the next present (options_answered). Test:
a_raise_frame_generation_refuses_is_asked_again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 00:54 UTC · original

Right, the miss program's place/gather/reflect passes call seen() too. Fixed in e114116e: depth is bound for Role::Resolve and Role::Miss (reads_depth); Radiance and Air still skip it. Regression test: ambient::tests::the_roles_given_depth_are_those_whose_passes_read_it, which checks each role's passes in the shader source for seen(.

**@⁠Adriwin06** on GitHub · 2026-11-30 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3065#discussion_r4734026534) Right, the miss program's place/gather/reflect passes call `seen()` too. Fixed in e114116e: depth is bound for `Role::Resolve` and `Role::Miss` (`reads_depth`); Radiance and Air still skip it. Regression test: `ambient::tests::the_roles_given_depth_are_those_whose_passes_read_it`, which checks each role's passes in the shader source for `seen(`.
@ -2582,3 +2582,3 @@
let on = on && wanted != 0;
let times = if on { wanted } else { 0 };
if on != calls.framegen_on || times != calls.framegen_times {
let raise = on && calls.framegen_on && FG_RAISE.swap(false, Relaxed);
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 00:54 UTC · original

Fixed in af5008cc: FG_TIMES now changes only when slDLSSGSetOptions takes the options (OK, or the accepted out-of-VRAM warning), and a refused raise sets FG_RAISE again so it is retried at the next present (options_answered). Regression test: streamline::framegen_tests::a_raise_frame_generation_refuses_is_asked_again.

**@⁠Adriwin06** on GitHub · 2026-11-30 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3065#discussion_r4734026720) Fixed in af5008cc: `FG_TIMES` now changes only when `slDLSSGSetOptions` takes the options (OK, or the accepted out-of-VRAM warning), and a refused raise sets `FG_RAISE` again so it is retried at the next present (`options_answered`). Regression test: `streamline::framegen_tests::a_raise_frame_generation_refuses_is_asked_again`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3065'
git switch 'github-bot/gh-3065'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3065'
git switch 'github-bot/gh-3065'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3065'
git switch 'main'
git merge --squash 'github-bot/gh-3065'
git switch 'main'
git merge --ff-only 'github-bot/gh-3065'
git switch 'main'
git merge 'github-bot/gh-3065'
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!3065
No description provided.