Repository navigation
NieR:Automata optimization: lean, hoisted and mesh-drawn passthrough geometry; Asian release profile - #416
Closed
JioChoi wants to merge 5 commits into
Closed
NieR:Automata optimization: lean, hoisted and mesh-drawn passthrough geometry; Asian release profile#416JioChoi wants to merge 5 commits into
JioChoi wants to merge 5 commits into
Conversation
…geometry, Asian release profile Passthrough geometry shaders (NieR's four IndexBuildIndependent_* culling kernels): - dmsh_geometry.lean: a lean kernel per point / line / triangle input that writes only the viewport mask and reads only the capture words it needs; the capture writes each word once through a slot table. The program's own vertex shader draws the kept primitives (geo_lean_tri: one fused index kernel for triangles). - geo_hoist_scan / geo_flush: lean draws after the first are prepared before the pass opens and batched into one capture encoder and one compute encoder, so the pass is not broken per geometry draw. CPU fast path for list draws without restart. - dmsh_mesh.py: a pair listed in the profile's geo_mesh.tsv gets a mesh library <vertex>_<geometry>_m3 (pulling vertex shader + lean kernel body); the host draws a non-instanced triangle list as one mesh draw inside the render pass (geo_mesh_draw, DM_NVN_GEO_MESH=0 off), with its pipeline built in the background. - Upload staging blocks grow to their high-water mark instead of allocating fresh 32 MB blocks per batch. Profile 0100B8E016F76000 (Asian release, main 98397a10...): the global profile's keys, its dynamic-resolution and frame-interval cuts moved to this build, and the k_nier_dr row for its addresses (t_resolution covers it). M1 Mac, 720p: opening flight 50 ms -> 16.7 ms a frame; Resistance Camp 21.2 ms -> 16.6 ms (translation 184 M -> 91 M instructions a frame with the mesh path). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DeVTtag93HemhN1mNA4qhW
seedds
added a commit
that referenced
this pull request
Oct 28, 2026
Reconcile the current #336 geometry, upload and resolution work with #416's lean passthrough and mesh paths on main. Preserve buffer dependencies, query ordering, target selection and chain/cache validation. Keep mesh primitive IDs draw-wide and rebase only local capture reads. Snapshot recursive split descriptors before child draws reuse the shared geometry job, fixing the Octopath first-attack index-range corruption. Retain emitted-vertex feedback, pause/resume ordering and raster discard through the new jobs without recapturing the synthetic raster reader. Co-authored-by: JioChoi <[email protected]> Co-authored-by: ThrecL <[email protected]>
Owner
|
Thank you for the lean and mesh geometry work, the performance measurements and the Asian release profile, and for preserving the authorship of #336's contributions. The NieR integration is now on I'm closing this PR because the work has been absorbed into |
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
Reconcile the current seedds#336 geometry, upload and resolution work with seedds#416's lean passthrough and mesh paths on main. Preserve buffer dependencies, query ordering, target selection and chain/cache validation. Keep mesh primitive IDs draw-wide and rebase only local capture reads. Snapshot recursive split descriptors before child draws reuse the shared geometry job, fixing the Octopath first-attack index-range corruption. Retain emitted-vertex feedback, pause/resume ordering and raster discard through the new jobs without recapturing the synthetic raster reader. Co-authored-by: JioChoi <[email protected]> Co-authored-by: ThrecL <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NieR:Automata's frame rate fell to about 15 fps on an iPhone 15 Pro in heavy scenes, and to 20 fps (50 ms frames) on an M1 Mac in the opening flight. Almost all of that cost came from emulating its four passthrough geometry shaders (
IndexBuildIndependent_*: a triangle cull that also writes a visible-index list).This PR builds on #336 and contains its four commits, rebased onto current main with authorship kept, plus one commit of its own (e7aad44). If #336 merges first, only that commit remains.
What changes
Lean passthrough kernels (
dmsh_geometry.lean,nvn_geometry.inc)dmsh_build.pynow also writes a lean kernel<key>_bl<topology>. It stores only the viewport-mask word, and it reads only the capture words it needs: 4 of 144 for NieR, about 970 lines instead of 10,500.geo_lean_tri) does this.DM_NVN_GEO_LEAN=0.Hoisting and batching (
geo_hoist_scan,geo_flush)DM_NVN_GEO_HOIST=0turns this off.Mesh draws (new
dm/gfx/tools/dmsh_mesh.py,geo_mesh_draw)geo_mesh.tsv.dmsh_build.pybuilds a mesh library<vertex>_<geometry>_m3for each listed pair, for Mac and iOS.[[primitive_culled]].nvn_rec.h) gainsdrawMeshThreadgroups.DM_NVN_GEO_MESH=0turns the mesh path off.zmap_vs_*, named by the shaders'.vso/.gsofiles) = 96 pairs. It is in both the global and the Asian profile, whose shader tables are identical.Other
Asian release profile
0100B8E016F76000mainbuild (98397a10…).k_nier_drrow for this build's addresses;t_resolutiongains anasiacase.The chain version is now
ba772bb1b213.dmsh_mesh.pyis a chain tool, andgeo_mesh.tsvis one of the profile's inputs.Measurements (M1 Mac, 720p handheld, otherwise idle)
In the camp, about 520 geometry draws a frame are mesh draws, and none fall back once their pipelines are built. The picture matches the compute path, shadows included. The mesh path also works with
DM_NVN_ENC_THREAD=1(the iPhone's deferred encoding).DM_NVN_GEO_LEAN_CHECK=2000@5600compared the lean kernel with the full kernel on 2,000 flight draws: identical index lists and vertices.Tests
test_dmsh_geometry.py: lean rewrite, its refusals, capture slot writes, and mesh compose plus a Metal compile. OK.make -C dm/gfx/tests run: OK,t_geometry1,066 checks, 0 failed.make -C dm/host/tests resolution: global and Asian builds, 30 / 60 fps × both modes. OK.test_patches.py,test_launcher_settings.py,test_nsp_chain.py,test_docs.py: OK.test_docswas run with the local work folder moved out of the tree; inside it, that folder's own profile copy has unresolvable links.scripts/regress.pywas not run. This Mac has no games library (/Volumes/NXis absent) and only NieR locally. The change reaches other games through:A regress run on the other geometry-shader games would be good before merging.
Not yet verified
🤖 Generated with Claude Code
https://claude.ai/code/session_01DeVTtag93HemhN1mNA4qhW