Repository navigation
Conversation
Two NVN issues found when bringing up Super Mario Party (010036B0034E4000): 1. Aliased virtual memory pools (vmode == 1) now keep the physical backing pool storage flags in host_flags (read via pool_host_flags) for texture initial fills, storage uploads, and FlushMappedRange dirty tracking, while nvnBufferMap and nvnMemoryPoolMap still inspect the virtual pool flags so CPU_NO_ACCESS remains enforced. If any texture, buffer, or pool GPU address is obtained before the first MapVirtual call, vpool_note_used marks the pool used so MapVirtual preserves sparse mode (vmode == 2) instead of aliasing over it. Frame capture and replay preserve host_flags. 2. nvnSamplerPoolInitialize now records the sampler pool capacity via mtl_set_samp_pool_n, and samp_by_id treats out-of-range sentinel sampler IDs (such as 4095) as empty slots returning nil without [RED] errors, while in-pool unregistered IDs still report [RED]. Frame capture and replay preserve samp_pool_n. Includes regression test dm/gfx/tests/t_vpool_alias.m covering uncached (0x22) and cached (0x24) aliased texture uploads, pre-mapping vmode == 2 preservation, and sampler pool capacity bounds. Refs seedds#2513
LNPANDY
added a commit
to LNPANDY/NX2Apple
that referenced
this pull request
Nov 12, 2026
…l IDs (#1227) Add patch 0045 (forwarded to seedds/nxnative#2519, Refs seedds/nxnative#2513) to resolve two NVN bugs hit during Super Mario Party (010036B0034E4000): 1. Aliased virtual memory pools (vmode == 1) now inherit the backing physical pool flags in host_flags while nvnBufferMap and nvnMemoryPoolMap still check virtual pool flags for CPU_NO_ACCESS, and pre-mapping pool use forces sparse mode (vmode == 2) via vpool_note_used. 2. nvnSamplerPoolInitialize records sampler pool capacity via mtl_set_samp_pool_n so out-of-range sentinel sampler IDs (such as 4095) return an empty slot cleanly instead of emitting [RED] errors, and dm_gfx_teardown resets g_spool_n and g_stat_samp_oob between iOS shell game runs. 3. Add dm/gfx/tests/t_vpool_alias.m (36 checks) and isolate nvn_hle_teardown in the single-TU test build.
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.
Summary
vmode == 1) viapool_host_flags, allowing CPU-written textures in pools such as0x22and0x24to upload and flush while preserving virtual poolCPU_NO_ACCESSbehavior innvnBufferMapandnvnMemoryPoolMap.vpool_note_usedso pools already bound to a texture, buffer, command memory, or GPU address stay in sparse mode (vmode == 2) instead of being aliased on the firstMapVirtual.mtl_set_samp_pool_nand returnnilfor out-of-range sampler IDs (such as sentinel4095) without false[RED]logs while keeping in-pool unregistered ID checks strict.host_flagsandsamp_pool_nin frame capture and replay (nvn_captureandnvn_replay).dm/gfx/tests/t_vpool_alias.m.Verification
make -C dm/gfx/tests GAME=01007EF00011E000 check_t_vpool_alias:t_vpool_alias: ok (36 checks)withMTL_DEBUG_LAYER=1(negative check removing the fix failed 10/36 assertions).t_border: 113 checks, 0 failed.t_readback: 217 cases, 0 failed.t_sparse_tiles: 4253 checks, 0 failed.t_copy_alias: 126 checks, 0 failed.t_large_mdi: passed.t_serial_owner: 176 checks, 0 failed.t_res_commit: 8 checks, 0 failed (MTL_DEBUG_LAYER=1).nvn_replay: compiled cleanly.python3 dm/tools/lint_c.py compdb: 291 sources (clang-tidynot installed locally).python3 -m unittest dm/tools/tests/test_docs.py dm/tools/tests/test_pr_areas.py: 11 tests OK.Refs #2513