Skip to content

Allow up to three compressed texture mip levels to be omitted - #1418

Open
givethesourceplox wants to merge 2 commits into
seedds:mainfrom
givethesourceplox:feat/nvn-compressed-mip-quality
Open

givethesourceplox wants to merge 2 commits into
seedds:mainfrom
givethesourceplox:feat/nvn-compressed-mip-quality

Conversation

@givethesourceplox

Copy link
Copy Markdown
Contributor

What and why

Extend the optional compressed-texture quality path from #1319 to omit one, two or three finest mip levels. DM_NVN_TEX_MIP_SKIP=<pixels> sets the width-and-height threshold; new DM_NVN_TEX_MIP_LEVELS=1..3 selects the reduction while always retaining at least one level. The feature remains off by default.

Keep the original coarser mip contents during upload, translate guest mip levels for views/copies/readbacks/sparse clamps, and refuse copies of removed levels. Recognize reduced textures only when both dimensions and mip count match an eligible compressed chain, avoiding accidental remapping of unrelated size differences. Compressed IMAGE resources retain read-only usage; shader-written textures and uncompressed render formats remain unchanged. Zero-block accounting indexes the retained host levels.

This deliberately trades close-up texture detail and original texture-size queries for reduced texture storage. It changes texture quality, not internal render resolution, and does not claim to fix the complete GPU or thermal bottleneck.

Dependency: the texture upload/view/copy portion of #1319, originating in fc815c3, is included as the separate prerequisite commit 4b13851. Credit for that one-level path belongs to #1319 (JioChoi). The next commit contains this multi-level extension, stricter recognition and fixture. Pool thresholds, raw-residency policy and other #1319 changes are excluded. The read-only compressed-image correction and SDK-26 MetalFX declaration prerequisite overlap #1404.

Reference finding.

Checked

Apple M1 Pro, macOS 26.5.2, Xcode 26.5:

  • check_t_texture_quality: 18 checks in each of four processes, all pass with Metal API validation: reduction off, and levels 1, 2 and 3 at threshold 512. A five-level BC1 texture has different data in each mip; GPU readback verifies retained contents and dimensions. Also checks guest-to-host mip mapping, removed-level copy refusal, minimum one retained mip, and unchanged small/uncompressed/shader-written/volume textures.
  • Documentation tests: 11 pass; chain tests: 17 pass; environment-switch registry: one test passes; git diff --check passes.
  • LLVM static analysis: no new findings.
  • No translation-chain or shader-profile inputs changed; no game shader rebuild.

No standalone Ocarina gameplay, isolated memory/FPS/thermal measurement or iPhone result is claimed for this branch. The local harness has only DK, MKW and Ocarina, no stored baselines and no DK/Ocarina smoke routes on this base. Cross-game runtime behavior, sparse streaming and explicit view/copy workloads still need broader coverage; the fixture verifies uploads and level-selection semantics.

Docs

  • Rendering reference and player environment-switch registry updated; symptom index regenerated.
  • Shader chain unchanged.
  • No game files, keys or extracted data included.

Texture upload, view and copy remapping subset of fc815c3 (PR seedds#1319 by JioChoi). Kept as a separate prerequisite commit so the multi-level extension is independently reviewable. Pool, raw-residency and diagnostic changes are excluded.
@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) docs Documentation labels Nov 5, 2026
Aeonitis pushed a commit to Aeonitis/nxnative that referenced this pull request Nov 6, 2026
…er and shader chain, the branch's host services, movie clock, packing and Ocarina of Time additions

Upstream reached about 60 fps in Kokiri Forest with its own versions of most of the branch's merged PRs, so where both changed the same code upstream's is kept:
- The shader chain is upstream's (translator, lock, dmsh tools, Ryujinx sources), plus the branch's bracket-depth flattening (dmsh_depth.py, test_dmsh_depth.py); chain c732699d4fdb.
  Not carried: the LDSM subgroup fence (seedds#1376, needs a translator rebuild; upstream's HMMA/LDSM rework reports clean movies) and the shared raw-memory lookups (seedds#1405, superseded by upstream's last-entry lookups).
- The renderer (dm/gfx/nvn, dm/gfx/msl) and its tests are upstream's. Not carried: seedds#1390-seedds#1394, seedds#1404, seedds#1408, seedds#1409, seedds#1417, seedds#1418, seedds#1420, seedds#1427, seedds#1320, seedds#1331, seedds#1332, seedds#1368, seedds#1285 renderer parts, pool_skip_retired, and the branch's warning fixes and prewarm progress there. They stay on oot-integration.
- Ocarina of Time's profile is upstream's, with the branch's 12 movie compute rows in pso_manifest.tsv, PLAN.md and PR-AUDIT.md.
- shader_split.py is upstream's plus the BAHS record check (test_split_bahs_records.py).
- Host: upstream's EventFd, PlayReport send, audio lock and vibration answers; the branch's service sessions (hle_sf, hle_prepo), sync waits, AV1 movie clock and parallel decode, diag_abort frame fix and focus control are kept.
- Scripts: shader.noindex, tmp.noindex, notes outside the shader key, bench and regress changes.

Checked: the Mac host builds (GAME=0400486024DEC000); host unit tests pass; the Python tool tests pass on Python 3.13 except test_dmsh_pool_arrays, test_nro_pack, test_nsp_dump and test_nsp_incremental, which fail on upstream main as well. Not run: the full shader build on this chain, gameplay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants