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 from
FIocker/super-build/core into main
pull from: FIocker/super-build/core
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
2 participants
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
MagicBeanDev/Hookshot!1834
Loading…
Reference in a new issue
No description provided.
Delete branch "FIocker/super-build/core"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.mdis built on.#1831, #1833 and this PR build only together. This PR includes
vk_dlssg.h,vk_ffx.h,framegen_methods.h,vk_dlssnr*.handvk_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/allis the three together, and it's what was built and tested. #1830 is separate and builds alone.super-build/shaders(#1830)super-build/upscaling-framegen(#1831)super-build/neural(#1833)super-build/core(#1834)What it does
Insert menu (
vk_menu.*):TAB_NEURAL = 5, after main's Audio tab (TAB_COUNT = 6), with its rows, including Stage (after or before the upscaler).nr_<name>(nr_model,nr_style,nr_preset, …) by one rule inini_key. The switch itself keepsneural_rendering.framegen_methods.h).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::applybehind!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.scene_depth.frame).scene_frame_inputsanswers only for this frame's or the last one's.scene_depthandscene_vpare written under a lock, sinceRX_VK_PARALLEL's workers resolve targets too.Upload hitches (
vk_texture.cpp,vk_memory.cpp):upload_unswizzle_gpuuses 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=1brings back the import.Lock diagnostics (
vk_internal.h,vk_memory.cpp,vk_texture.*):ParLockcounts by file and line, andmemory_pool_lock_reasonsandtexture_touch_missescount why the two busiest sites take the lock. These cost nothing while parallel replay is off.docs/performance.mdhas 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>inhookshot_options.ini, with no menu row. It sets__GL_SHADER_DISK_CACHE_SIZEand turns trimming off, only when asked and only where the environment doesn't set them. It's documented indocs/performance.md.Host:
nn_vi.c'sHOS_DISPLAY_VRR=1(opt-in) tells the game the display does variable refresh, which lifts its 60 fps limiter, andSetDisplay120HzRefreshRateCapabilityis 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:
--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.old_upscaling3/4) and the extratx_upscalelabels.tx_upscaleis main's.hos_sdl_refresh_hz()and theHOS_VSYNC_HZmention: neither was used.vk_main.cppandvk_menu.cpp.vk_slfg.cpp,nx2_sl.hand its hooks in Reflex, the device and the present (see #1831).Testing
tests/run_all.pyon the three together (super-build/all), locally (clang targeting MSVC, the CPM Vulkan headers, glslang 11.12): 328 passed. The only failures are the same 18 that main atd7a73062has on this machine, all down to this PC's toolchain.🤖 Generated with Claude Code
Heads-up: this conflicts with main now (a lot landed today). Could you merge main into the branch (or rebase) and resolve the conflicts? Thanks!
Thanks for splitting the super build up, it makes it a lot easier to read. I went through this one alongside #1830, #1831 and #1833 (and #1892, which touches the same
vk_draw.cpp/vk_menu.cpp/vk_menu.h). I'm leaving a comment rather than an approval: the branch is 321 commits behind main and conflicting (see my earlier note), so no CI has run on it. A few things also need fixing before it's worth rebasing.How the series fits together. This PR alone doesn't compile.
vk_main.cpp,vk_menu.cppandvk_replay.cppincludevk_dlssg.h,vk_ffx.h,vk_slfg.handframegen_methods.h(from #1831), andvk_streamline.h,vk_dlssnr*.handvk_opennr.h(from #1833). They also calldlss_nr_before_hud()and use thedlss_actor::kSingle/kPair/kNoWeightflags, both from #1831. That much the description says. But #1830 isn't independent either: itsvk_texture.cppcallsmemory_guest_contained(), which is added here, and this PR'svk_replay.cppcallstexture_touch_misses(), which only #1830 adds. (The description listsvk_texture.hunder this PR, but it isn't in the diff.) So all four have to land together, and none of them can go green in CI alone. Could you either make each one build on its own (move the shared declarations into the PR that uses them first, or stack the PRs) or say plainly in all four descriptions that they only build together? #1892 also editsvk_draw.cpp,vk_menu.cppandvk_menu.h, so expect conflicts there too.What the rebase will hit on main:
TAB_AUDIO = 1…TAB_DEBUG = 4,TAB_COUNT = 5.TAB_NEURAL = 4lands on Debug, andtab_titlesdrops Audio.package.jsonis gone, andrelease.ymlno longer runs semantic-release, so the--repository-urlchange and theconventional-changelog-conventionalcommitsdependency have nothing to apply to..github/workflows/linux-appimage.ymlisn't on main any more.tests/run_all.pyreads per-testRUN_ALL_ARGS/RUN_ALL_SKIPdeclarations since #1822. The new entries belong in the tests themselves, not in the central table. (Right now the table also hastests/test_fsr3_shaders.pytwice.)Bugs:
tests/test_rumble_menu.pyraises a NameError:"wheel": block(tick, loop)uses two names thatmenu_fixture()never defines, and the template has no%(wheel)sanyway. It looks like a merge leftover (inline).scene_depthonly ever grows (inline). It keeps the largest depth target ever seen and is never reset. Lower the render resolution, or have the texture cache drop that depth image, andscene_frame_inputs()keeps handing a destroyed image and view to the open NR backend. UnderRX_VK_PARALLEL,targets()andcapture_view_projection()also writescene_depth/scene_vpfrom worker threads without a lock.do_presentcallsdlssnr::applywithout the!dlss_nr_before_hud()guard thatpresent_imagehas, and through a different entry point (nr::applyis used in the window path). With Stage = Before upscaler, a headless run applies NR twice (inline).nn_vi.cgetsHOS_VSYNC_HZandhos_sdl.*getshos_sdl_refresh_hz()for it. Only the comment mentionsHOS_VSYNC_HZ, there's no code that reads it, and nothing in any of the four PRs callshos_sdl_refresh_hz().Things NotRexed should decide (not mine to call):
framegen_available()never sets the FSR bits, so with #1831'svk_framegen.cpp, FSR 3.1's 2x frame generation, which runs on any GPU on main today, stops for everyone, AMD and Intel included. The menu keeps dead "AMD FSR 4" / "AMD FSR 3.1" entries and hints. If FSR FG misbehaved on your setup, that's worth an issue with details, not a silent removal.row_shown(), but it still takes a restart and savesstreamline_frame_generation. If it's retired, I'd leave the row out entirely.--accept-nvidia-licenseand linking it into the published AppImage is a release and licence decision.vk_main.cppsets__GL_SHADER_DISK_CACHE_SIZE=10GBandSKIP_CLEANUP=1for every Windows player who hasn't set them. That's a big default on someone else's disk, and the description doesn't mention it.repository.txt,HOOKSHOT_REPOSITORY) and the prebuilt-renderer path (tools/prebuilt,tools/amd-fsr) have nothing to do with the menu or renderer, and they'd be easier to judge as their own PR. On Windows they're also inert as written:windows-builder.ymlpasses neither--vk,--amd-fsr,--repositorynor aHOOKSHOT_REPOSITORYdefine, so the setup's and Builder's repository and the prebuilt DLL are never produced.Nits:
old_upscaling3/4 →opts.dlss, plustx_upscalegaining "FSR 3.1"/"DLSS" andwindow_filter(). Upstream's Upscaling row never had 3 or 4.model,style,preset,intensity,local_tone… You already special-casednr_backend/nr_stagefor exactly this reason. Prefixing the rest withnr_too would avoid a clash with a future row.vk_menu.hcomment onnr_backendlists 0–2, but the row has a 3 (Open).docs/performance.mdcontradicts itself. "It is not the lock, and tuning does not rescue it" is followed by "It is serialised on one lock … splitting that lock … is the work that would make it pay". It also quotesvk_draw.cpp:1820-style line numbers that will drift.vk_main.cppincludesvk_dlss.htwice, andvk_menu.cppincludesvk_fsr3.h/vk_fsr3fi.htwice.Happy to look again once it's rebased and the series builds piece by piece (or is clearly marked as one unit).
This is a high-water mark that's never reset. If the render resolution drops, or the cache drops this depth texture, nothing smaller replaces it, and
scene_frame_inputs()keeps returning a destroyedVkImage/VkImageViewto the open NR backend. Could it be refreshed per frame instead, e.g. the largest one seen this frame, cleared at present? It's also written from worker threads underRX_VK_PARALLELwith no lock (same forscene_vp).@ -37,7 +43,42 @@ VKX_DEVICE3(VKX_DEFINE)static PFN_vkGetInstanceProcAddr get_instance_proc;10 GB with no cleanup is a big default to put on every Windows player's disk, and the description doesn't mention it. I'd make it opt-in, or at least call it out in the description and docs.
@ -62,7 +69,10 @@ enum MenuTab {TAB_GAMEPLAY = 2,TAB_CONTROLS = 3,On main, tab 4 is
TAB_DEBUGnow (an Audio tab went in at 1), so the rebase needsTAB_NEURAL = 5,TAB_COUNT = 6, and Audio kept intab_titles.@ -629,0 +710,4 @@static const char* t[] = {"Auto", "NVIDIA DLSS", "AMD FSR 4", "AMD FSR 3.1", "Built-in"};return t[fgm::effective(v, framegen_available())];}const char* hn_framegen_method(int v, int variant) {With
framegen_available()never setting the FSR3 bit, this is never true, and with #1831 FSR 3.1's 2x frame generation no longer runs for anyone, though it works on main on any GPU. That's a decision for NotRexed, but it should be one on purpose, with the reason written down.The window path (
present_image) usesnr::applybehind!dlss_nr_before_hud(). This path callsdlssnr::apply(Streamline only?) without the guard, so headless runs with Stage = Before upscaler apply NR twice, and the NGX/Open backends are skipped here. Same call and guard aspresent_image?HOS_VSYNC_HZis mentioned here and in the description, but nothing reads it, andhos_sdl_refresh_hz()isn't called anywhere in the series. Either the code is missing or the comment and description are ahead of it.tickandlooparen't defined inmenu_fixture()(or at module level), so this raises a NameError and the whole check fails.FIXTUREhas no%(wheel)seither. Looks like a leftover from a merge: I think the line can just go.Thanks for going through the whole series; it changed a lot. I rebuilt it on main at
d7a73062. The descriptions are rewritten.How the series fits together: #1830 now builds on its own. Its
vk_texture.cppchanges,memory_guest_containedandtexture_touch_missesmoved 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/allis the three together. Thevk_texture.hline in the old description was wrong; it's fixed.What the rebase hit:
TAB_NEURAL = 5after main's Audio tab,TAB_COUNT = 6, and Audio kept intab_titles.--repository-url, the npm dependency,package.jsonand.releaserc.jsonare all gone (main uses release-please). So arelinux-appimage.yml's changes, including the NGX SDK fetch.run_all.py: main's per-testRUN_ALL_ARGS/RUN_ALL_SKIP. The opennr tests andtest_framegen_methods.pydeclare theirs; nothing goes in the retired tables, and the duplicatetest_fsr3_shaders.pyentry went with them.Bugs:
test_rumble_menu.py: the leftoverwheelline is gone.scene_depth: now the largest depth of this frame (scene_depth.frame), andscene_frame_inputsanswers only for this frame's or the last one's. Bothscene_depthandscene_vpare written under a lock.nr::applybehind!dlss_nr_before_hud(), the same call and guard aspresent_image.HOS_VSYNC_HZandhos_sdl_refresh_hz(): both removed, since they were unused.Your list for NotRexed:
RX_VK_FSR_FG=1, #1635), so the series follows main there. #1831 says why FidelityFX FSR 4's isn't offered either, and the method enum keeps both values so a saved choice reads as Auto.vk_slfg.cpp,nx2_sl.h, its row, and its hooks in Reflex, the device and the present).nvidia_shader_cache_gb=<GB>in the options file, documented indocs/performance.md.Nits:
old_upscalingand the extratx_upscalelabels are gone.nr_<name>by one rule inini_key.nr_backendcomment lists 0-3.docs/performance.mdno longer contradicts itself and names functions, not line numbers.vk_main.cppandvk_menu.cppare gone.Tests:
tests/run_all.pyon 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.Heads-up: this conflicts with main now. Could you rebase onto main and resolve the conflicts? Thanks!
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.
Closing, as suggested. With #1831 gone this plumbing has no series left, so its pieces went where they belong:
env_on), and the CPU unswizzle threaded from 4 MB.docs/performance.mdare #2786.nr_settings()and the chain and present hooks that neural rendering needs are being folded into #1833, rebuilt on main on top of #2118's NGX session.Thanks for the reviews.
github-sync referenced this pull request2026-11-12 13:39:06 +00:00