Skip to content

feat: menu, renderer and build plumbing for #1831/#1833; upload hitches; lock diagnostics (builds with #1831, #1833) - #1834

Closed
FIocker wants to merge 1 commit into
NotRexed:mainfrom
FIocker:super-build/core
Closed

FIocker wants to merge 1 commit into
NotRexed:mainfrom
FIocker:super-build/core

Conversation

@FIocker

@FIocker FIocker commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The upscaling (#1831) and neural rendering (#1833) work needs menu rows, renderer hooks and build changes; this PR is those. It also fixes two upload hitches and adds the lock diagnostics docs/performance.md is built on.

#1831, #1833 and this PR build only together. This PR includes vk_dlssg.h, vk_ffx.h, framegen_methods.h, vk_dlssnr*.h and vk_opennr.h, and the other two use this one's rows and hooks. Please review and merge the three as one unit; FIocker:super-build/all is the three together, and it's what was built and tested. #1830 is separate and builds alone.

Part Branch Builds
Shader fixes super-build/shaders (#1830) on its own
Upscaling and frame generation super-build/upscaling-framegen (#1831) with #1833 and this PR
DLSS 5 neural rendering super-build/neural (#1833) with #1831 and this PR
Menu, renderer and build plumbing (this PR) super-build/core (#1834) with #1831 and #1833

What it does

Insert menu (vk_menu.*):

  • The Neural tab is TAB_NEURAL = 5, after main's Audio tab (TAB_COUNT = 6), with its rows, including Stage (after or before the upscaler).
  • Saved keys: the tab's rows are saved as nr_<name> (nr_model, nr_style, nr_preset, …) by one rule in ini_key. The switch itself keeps neural_rendering.
  • Frame generation method: Auto, NVIDIA DLSS or Built-in, of what runs here (framegen_methods.h).
  • Upscaler row: AMD's FidelityFX FSR 4 counts as FSR 4 where main's FSR 4 engine isn't built (ffx::upscale_supported).

Renderer:

  • vk_main.cpp: device features and extensions for NGX and OpenDLSS-NR.
  • vk_replay.cpp: the present's NR pass is skipped when the chain already ran it. The headless present now uses the same call and guard (nr::apply behind !dlss_nr_before_hud()), so a headless run with Stage = Before upscaler no longer applies NR twice.
  • vk_draw.cpp: the scene's view-projection capture, and skinned-draw detection for the new actor formats.
  • The scene depth handed to NR is now the largest depth target of this frame, not the largest ever (scene_depth.frame). scene_frame_inputs answers only for this frame's or the last one's. scene_depth and scene_vp are written under a lock, since RX_VK_PARALLEL's workers resolve targets too.

Upload hitches (vk_texture.cpp, vk_memory.cpp):

  • No import for one upload: upload_unswizzle_gpu uses the GPU path only from a pool that is already imported (memory_guest_contained). An import made for one upload took 22-25 ms on the replay thread, and three of them, when the camera turns to the Deku Tree, made a 60 ms hitch. RX_VK_UNSWIZZLE_IMPORT=1 brings back the import.
  • Threaded CPU unswizzle from 4 MB instead of 16 MB. The scene-size targets uploaded at that moment (2779 × 1318 RGBA8, 15 MB) took about 20 ms each on one thread.

Lock diagnostics (vk_internal.h, vk_memory.cpp, vk_texture.*): ParLock counts by file and line, and memory_pool_lock_reasons and texture_touch_misses count why the two busiest sites take the lock. These cost nothing while parallel replay is off. docs/performance.md has the numbers; it no longer contradicts itself and names functions instead of line numbers.

NVIDIA's shader disk cache is opt-in: nvidia_shader_cache_gb=<GB> in hookshot_options.ini, with no menu row. It sets __GL_SHADER_DISK_CACHE_SIZE and turns trimming off, only when asked and only where the environment doesn't set them. It's documented in docs/performance.md.

Host: nn_vi.c's HOS_DISPLAY_VRR=1 (opt-in) tells the game the display does variable refresh, which lifts its 60 fps limiter, and SetDisplay120HzRefreshRateCapability is answered.

Build (nx2/build.py): NGX flags for every file that sees NVIDIA's headers (vk_dlss, vk_ngx, vk_dlssg, vk_dlssnr_ngx), OpenDLSS-NR's PTX kernels, and Streamline's SDK path for the NR backend.

Tests: main's fixtures that cut our changed functions out get the stubs they now need (direct_buffer_writes, dlss_sdk_cache, framegen_preset, present_geometry_trace, present_source_crop, stick_dead_zone, temporal_jitter, upscale_independent, audio_output_menu, rumble_menu, shader_stamp_cache). None of their checks are weakened.

Taken out since the first review

Everything below is gone from the series:

  • Fork release and update plumbing: semantic-release and --repository-url, package.json, repository.txt / HOOKSHOT_REPOSITORY, the prebuilt-renderer path, and the Linux workflow's NGX SDK fetch. Main has moved to release-please, and the rest was inactive on Windows anyway.
  • The old Upscaling-row migration (old_upscaling 3/4) and the extra tx_upscale labels. tx_upscale is main's.
  • hos_sdl_refresh_hz() and the HOS_VSYNC_HZ mention: neither was used.
  • The duplicate includes in vk_main.cpp and vk_menu.cpp.
  • Streamline frame generation: its row and vk_slfg.cpp, nx2_sl.h and its hooks in Reflex, the device and the present (see feat(vk): DLSS frame generation (NGX), more actor motion for DLSS, FidelityFX FSR 4 fallback (builds with #1833, #1834) #1831).

Testing

🤖 Generated with Claude Code

…s; lock diagnostics (builds with NotRexed#1831 and NotRexed#1833)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIocker added a commit to FIocker/Hookshot that referenced this pull request Nov 11, 2026
…SS frame generation (NGX), FSR 4 fallback (builds with NotRexed#1833 and NotRexed#1834)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIocker added a commit to FIocker/Hookshot that referenced this pull request Nov 11, 2026
…R), before the HUD or before the upscaler (builds with NotRexed#1831 and NotRexed#1834)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FIocker FIocker changed the title feat: menu, renderer and build plumbing for the super build; fork-aware updates (super build 4/4) feat: menu, renderer and build plumbing for #1831/#1833; upload hitches; lock diagnostics (builds with #1831, #1833) Nov 11, 2026
@FIocker

FIocker commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for going through the whole series; it changed a lot. I rebuilt it on main at d7a7306. The descriptions are rewritten.

How the series fits together: #1830 now builds on its own. Its vk_texture.cpp changes, memory_guest_contained and texture_touch_misses moved here, and I checked it with the full test suite locally. #1831, #1833 and this one still need each other, and all three descriptions now say so plainly, at the top, with a table. Splitting them along file lines would mean shipping half-wired rows, so I'd rather they're reviewed as one unit; super-build/all is the three together. The vk_texture.h line in the old description was wrong; it's fixed.

What the rebase hit:

  • Tabs: TAB_NEURAL = 5 after main's Audio tab, TAB_COUNT = 6, and Audio kept in tab_titles.
  • Release plumbing gone: semantic-release, --repository-url, the npm dependency, package.json and .releaserc.json are all gone (main uses release-please). So are linux-appimage.yml's changes, including the NGX SDK fetch.
  • run_all.py: main's per-test RUN_ALL_ARGS / RUN_ALL_SKIP. The opennr tests and test_framegen_methods.py declare theirs; nothing goes in the retired tables, and the duplicate test_fsr3_shaders.py entry went with them.

Bugs:

  • test_rumble_menu.py: the leftover wheel line is gone.
  • scene_depth: now the largest depth of this frame (scene_depth.frame), and scene_frame_inputs answers only for this frame's or the last one's. Both scene_depth and scene_vp are written under a lock.
  • Headless present: nr::apply behind !dlss_nr_before_hud(), the same call and guard as present_image.
  • HOS_VSYNC_HZ and hos_sdl_refresh_hz(): both removed, since they were unused.

Your list for NotRexed:

Nits:

  • Upscaling migration: old_upscaling and the extra tx_upscale labels are gone.
  • ini keys: the Neural rows are saved as nr_<name> by one rule in ini_key.
  • Comments: the nr_backend comment lists 0-3.
  • Docs: docs/performance.md no longer contradicts itself and names functions, not line numbers.
  • Includes: the duplicates in vk_main.cpp and vk_menu.cpp are gone.
  • Screenshots of the Neural tab and the Frame generation method row will follow from an in-game run.

Tests: tests/run_all.py on the three together, locally (clang targeting MSVC, the CPM Vulkan headers, glslang 11.12), gives 328 passed. The failures are only the same 18 main has on this machine. Main's fixtures that cut our functions out now get stubs for them, with no checks weakened.

@Joey-Magnus Joey-Magnus 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.

With #1831 closed in favour of #2118, this plumbing no longer has the series it was built for, so I'd close it. It includes vk_dlssg.h, vk_ffx.h and framegen_methods.h from #1831 and vk_dlssnr*.h / vk_opennr.h from #1833. It also conflicts with main in seven files: vk_menu.cpp, vk_menu.h, vk_replay.cpp, nx2/build.py, two present tests and test_shader_stamp_cache.py. Two pieces stand on their own and would be welcome as small PRs on main. One is the upload hitch fix: no pool import for a single upload_unswizzle_gpu, and the threaded CPU unswizzle from 4 MB. The other is the lock diagnostics. If the vk_main.cpp default for __GL_SHADER_DISK_CACHE_SIZE / SKIP_CLEANUP comes back, it needs its own PR and a maintainer decision, as hckrman101 noted, since it changes disk use for every Windows NVIDIA player.

@FIocker

FIocker commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Closing, as suggested. With #1831 gone this plumbing has no series left, so its pieces went where they belong:

Thanks for the reviews.

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.

2 participants