Repository navigation
Conversation
Patch 0078 completes bc-cpu-decode. With tex_bc_cpu on a GPU without BC support, a BC view of a decoded texture asked Metal for a BC format the device cannot make (validation abort), and the GPU upload routes copied raw BC blocks into the decoded texture (block noise). Views now take the decoded format and decoded BC textures always take the CPU route. Found on Super Mario Bros. Wonder on an iPhone 13 Pro (A15). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@bmle69 thanks for the fix and for the check on a device. Two points. The issue for this crash is #732 (v1.2.4), please link it in the PR. And #446 changes the same area (views and uploads of CPU-decoded BC textures). Please say how this PR relates to #446, so the maintainers can decide which one to take. |
|
A15 / 4 GB, a second title: same three states, 50,665 frames, no abort iPad mini 6 (A15, 4 GB), iOS 27.2 (24B119), engine
Before - views fixed, upload still GPU. Hearts, HUD and 2D art are fine; only BC surfaces are wrong, which is why it reads as "textures broken" rather than "renderer broken": After - same room, same build, decoded textures forced onto the CPU route: Why the middle state belongs in the PR description. 4 GB budget, one session, 940 s / 50,665 frames:
Two long frames (10.8 s at 144.9 s, 5.9 s at 482.5 s) are not engine work: Check: On the two questions the maintainer raised: this is a datapoint for #732, and for the choice against #446 it says only that with these two gates and nothing else, two different titles on A15 run correctly and stay inside 4 GB - no startup dispatch is needed for them. Separately, #777 would land right on the 47-50 MB upload spikes above. If an A15 run against this branch is useful before the merge, I can rebuild once it is rebased on the current pin and repeat the session. |
|
Closing as superseded by #888, now merged into main at 908e4e8. I compared this PR’s complete scope (one engine patch plus the series entry). The landed patch keeps CPU-decoded BC textures off the direct, large-source and staged GPU compressed-block upload paths, and maps sampled and clear views to the decoder’s formats. It also covers attachment/render-target views. That covers the upload/view changes proposed here, with no distinct code left to merge from this PR. The current-pin production GPU regression passed 349 checks on Apple M2 Max, all CI checks were green, and the maintainer tried the CI-built app before the GitHub merge. This does not claim a fresh current-pin A15 gameplay run. Thank you for isolating both halves of the fix, and for the additional historical device evidence in this discussion. #732 remains the linked problem report. #446 still has separate work and remains open. |


Fix or feature
What and why
With
tex_bc_cpuon a GPU without BC support (A15/A16),bc-cpu-decodemakes a BC texture in the format the decoder produces (RGBA8, R8, RG8, RGBA16F), but two paths innvn_mtl.mstill treated it as BC.Abort on the first BC view.
tex_by_idandclear_texasked Metal for the view's BC format, which the device can't make, so the result wasMTLPixelFormatInvalidand Metal's validation aborted (exit 134):Now a BC view of a decoded texture takes the decoded format (
bc_cpu_view_pf).Block noise on most textures.
pkg_upload_tried its GPU routes first: direct, deswizzle + blit, and the big-source buffer. Those routes copy compressed blocks unchanged, so raw BC blocks landed in the decoded texture as pixels. Only the CPU route decodes. A decoded BC texture now always takes that route.GPUs with BC support are unchanged:
bc_cpu_view_pfreturns 0 wheng_bc_cpuis off.Checked
python3 tools/engine.py checkpasses (47 patches on 7249ee9f).nvn_mtl.mcompiles for arm64 iOS 26 (-fsyntax-only).g_bc_cpucan't be on there). Checked on a device instead, below.DM_PROF_TEX_BC_CPU=1).[RED]lines.upsrcroute gets the same gate.Screenshots
None, no visible launcher change. (In-game before/after on request.)
Scope
patches/, andtools/engine.py checkpasses, withUpstream-Status: fork-only (declined seedds/nxnative#488)🤖 Generated with Claude Code