mirror of
https://github.com/seedds/nxnative.git
synced 2026-11-23 11:39:42 -10:00
Port The Binding of Isaac: Rebirth
Add the base 1.0 profile, captured shader tables, prewarm seed, smoke route and game note. Mac gameplay covers movement, shooting, a room clear, saving and Continue at 60 fps, with no game or SDK rewriter cuts. Declare the blend helper output as a thread reference. Its missing address space prevented all ten pixel shaders from compiling for the iOS target. Cover both SDK compiler modes in the existing test and update the shared chain stamp. All 19 shaders now build for Mac and iOS; the unsigned IPA was packed and verified. Validation: native Metal graphics suite, 475 graphics Python checks, 93 profile/chain/packing checks, exact captured-frame replay, and diff review. The 1449 tool checks retain one pre-existing environment-switch documentation failure; Python lint retains an unchanged unused import. Regression risk is low: the helper now explicitly names its existing local address space. Isaac was run; no additional game regressions were needed. iPhone, later floors, local co-op and longer sessions remain untested. Co-authored-by: seedds <[email protected]>
This commit is contained in:
1 parent
084f5aa5c5
commit
8fb5ffeb1f
16 files changed
+182
-9
No files matched your search
@@ -0,0 +1,44 @@
|
||||
# The Binding of Isaac: Rebirth (`01009BC00C38A000`)
|
||||
|
||||
Base game 1.0 (v0), SDK 5.5.0, its own engine on NVN. Modules `main`, `subsdk0` (GLSLC), `subsdk1` (Nintendo's movie player) and `sdk`.
|
||||
|
||||
On the Mac: the opening movie, title, file selection, New Run as Isaac, Basement I, movement and shooting with both sticks, a room transition, a room clear with a key reward, and exit to the main menu with a saved run. Continue restores the room, health, reward and player. The initial three-minute windowed run used the Metal HUD and real audio, with no red diagnostic or crash. Steady gameplay frame p50 was 16.66–16.69 ms (60 fps), GPU p50 about 1.1 ms. Not run on the iPhone yet.
|
||||
|
||||
## What it needs
|
||||
|
||||
The provisional profile's memory and rendering defaults held. No host change, game-specific rewriter cut, or SDK cut was needed. An iOS compiler error in the shared shader chain needed one fix (see [Found on this game](#found-on-this-game)).
|
||||
|
||||
| Setting | Where | Why |
|
||||
|---|---|---|
|
||||
| `modules main subsdk0 subsdk1 sdk` | [`game.tsv`](game.tsv) | the game compiles its embedded shaders with `subsdk0`; `subsdk1` supplies the movie player |
|
||||
| `sys_resource 0x0` | `game.tsv` | the NPDM declares no system resource: no virtual address memory, as on Horizon |
|
||||
| `mem_reserve 0x100000000`, `mem_alias 0x10000000`, `mem_stack 0x10000000`, `app_pool 0xCD500000` | `game.tsv` | the ordinary 4 GB layout; the game takes a 3.14 GB heap within its 3.25 GB heap region |
|
||||
| `pad_layout full` | `game.tsv` | a right stick for directional shooting beside the left stick for movement; face buttons also shoot |
|
||||
|
||||
The window origin is upper left. The presented picture is 1920x1080. Audio uses the SDK 5 renderer (48 kHz, 240 samples per frame, 24 voices); the initial run's device callback reports had no underrun.
|
||||
|
||||
## Shaders
|
||||
|
||||
`main` contains 20 GLSL source strings. At boot its own GLSLC (API 17.17, GPU code 1.15) produces 19 single-stage outputs: 9 vertex and 10 pixel shaders. All 19 translate and build for both the Mac and iOS. The NSP script captures them automatically into the extraction's `glslc_capture` folder, using the existing [runtime GLSLC capture](../../../docs/reference/shaders.md#built-in-shaders-compiled-with-the-games-own-glslc) path. The default translator binding layout works.
|
||||
|
||||
The map, pairs and facts come from that capture. [`pso_manifest.tsv`](pso_manifest.tsv) records the initial Mac route through the opening, menus and first room clear.
|
||||
|
||||
## Memory
|
||||
|
||||
A separate 90-second fresh-save boot followed the smoke route and then stood in the starting room for over a minute: the host's resident-memory report moved from 561 MB at frame 900 to 564 MB at frame 3900, and Metal allocations stayed at 370 MB. There was no continued resource allocation in the last minute's residency reports. The initial three-minute interactive route ended at 586 MB resident and 482 MB of Metal allocations after movie/menu/room transitions and diagnostic screenshots.
|
||||
|
||||
## Mac routes
|
||||
|
||||
The build and work folders are `<NSP folder>/01009BC00C38A000_build` and `<NSP folder>/01009BC00C38A000-work`. Run the NSP script with `--platform mac`; the work folder's `run/boot.py <log> [seconds] [KEY=VALUE ...]` runs an isolated `isaachost` copy with the window, HUD and audio, and accepts input through `run/ctl.txt`.
|
||||
|
||||
From a fresh save: A skips the opening, A on the title, A on file 1, A on New Run, A on Isaac. [`smoke.tsv`](smoke.tsv) spaces these by 120 presented frames from frame 300, then stands in the safe starting room. Left stick moves, right stick shoots, Plus pauses. Exit Game in the pause menu saves the run and returns to the main menu, where Continue is selected.
|
||||
|
||||
## Found on this game
|
||||
|
||||
- **The blend helper's output reference on iOS:** the shared shader helper now names the `thread` address space of its output, and its compiler test covers the packing script's iOS target as well as the Mac: [reference](../../../docs/reference/shaders.md#the-blend-helpers-output-reference-on-ios).
|
||||
|
||||
## Open
|
||||
|
||||
- iPhone gameplay and touch controls remain untested.
|
||||
- Only the supplied base version was checked; later floors, bosses and local co-op were not tested.
|
||||
- Longer sessions and memory behaviour across many rooms remain unverified.
|
||||
@@ -0,0 +1 @@
|
||||
# generated
|
||||
|
@@ -0,0 +1,37 @@
|
||||
# The Binding of Isaac: Rebirth 1.0 (base), SDK 5.5.0, NVN.
|
||||
# No game-specific rewriter cuts or host overrides.
|
||||
|
||||
# ---- Identity ----
|
||||
title_id 01009BC00C38A000
|
||||
program_id 01009BC00C38A000
|
||||
|
||||
# ---- App ----
|
||||
name The Binding of Isaac: Rebirth
|
||||
ipa TheBindingOfIsaacRebirth.ipa
|
||||
app_category public.app-category.games
|
||||
# Left stick moves; the right stick shoots. Face buttons also shoot.
|
||||
pad_layout full
|
||||
|
||||
# ---- Versions ----
|
||||
build v0 1.0 main=3b9cf053a86e902e013d72daaa156a94 subsdk0=7a7ca048269ec2e6ed9a2d812a951d9f subsdk1=66ce9a2e7c75fc6d0a7fe1b5d6d5baee sdk=5afd9bdf1a579f10081d2ba1c4f9c7ac
|
||||
package v0
|
||||
shader_versions v0
|
||||
|
||||
# ---- Files ----
|
||||
# every module main imports from
|
||||
modules main subsdk0 subsdk1 sdk
|
||||
romfs_marker resources/sfx.zip
|
||||
zip_store .b:.mp4:.ogg:.png:.zip:.metallib
|
||||
|
||||
# ---- Memory ----
|
||||
# main sets a heap of at most the pool − 64 MB: a 3328 MB heap region
|
||||
mem_reserve 0x100000000
|
||||
mem_alias 0x10000000
|
||||
mem_stack 0x10000000
|
||||
app_pool 0xCD500000
|
||||
# The NPDM declares no system resource: no virtual address memory, as on Horizon.
|
||||
sys_resource 0x0
|
||||
|
||||
# ---- Shader split ----
|
||||
shader_groups /resources/=resources /resources.kr/=resourceskr /resources.jp/=resourcesjp /sce_sys/=scesys
|
||||
shader_note The Binding of Isaac: Rebirth shaders
|
||||
|
@@ -0,0 +1,27 @@
|
||||
# Prewarm seed list recorded on the Mac: intro, menus, Basement I and a room clear.
|
||||
S c8d4c2fff8a91023_b 0
|
||||
S 94d3a46798b91027_b 1
|
||||
S 8062ae7b88cef0c0_b 0
|
||||
S d48a29200efe0442_b 1
|
||||
S f8c8d55af8d5324a_b 1
|
||||
S 1554a979ff3249c7_b 0
|
||||
S 41e078ba80c2b223_b 1
|
||||
S d6b297d6e00900bc_b 0
|
||||
S 196fa5ee57a17cbb_b 1
|
||||
S 9f6d3b3a0024581c_b 0
|
||||
S 8b6227e68ba96e1b_b 1
|
||||
S 2f40d0d204672252_b 0
|
||||
S eb35ddc4c04b0e39_b 1
|
||||
S f1fe2d6932030220_b 0
|
||||
S a61a82830c29ff06_b 1
|
||||
S 4b10090ca4947349_b 0
|
||||
S ab064f1c8b317af2_b 1
|
||||
S 085d495fbd125c79_b 0
|
||||
S 839563c8e270b794_b 1
|
||||
R 633864346332666666386139313032335f62000000000000393464336134363739386239313032375f6200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000fc0000000000000001000000000000000f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e0c00002200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
R 326634306430643230343637323235325f62000000000000656233356464633463303462306533395f6200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000fc0000000000000001000000000000000f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a1400000a18000022000000160c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
R 313535346139373966663332343963375f62000000000000343165303738626138306332623232335f6200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000fc0000000000000001000000010000000f00000000000000101804860400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e0c0000223400002e24000022000000161c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
R 633864346332666666386139313032335f62000000000000393464336134363739386239313032375f6200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000fc0000000000000001000000010000000f00000000000000101804860400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e0c00002200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
R 383036326165376238386365663063305f62000000000000643438613239323030656665303434325f6200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000fc0000000000000001000000010000000f00000000000000101804860400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e0c000022000000161c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
R 383036326165376238386365663063305f62000000000000643438613239323030656665303434325f6200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000fc0000000000000001000000000000000f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e0c000022000000161c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
R 383036326165376238386365663063305f62000000000000643438613239323030656665303434325f6200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004600000000000000000000000000000000000000000000000000000000000000fc0000000000000001000000010000000f00000000000000481812860400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e0c000022000000161c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
|
@@ -0,0 +1 @@
|
||||
# kind: evidence supplemental vertex / pixel shader pairs (BAHS program variations and legacy Unity pass-input covers) for vertex output padding and the pipeline prebuild (generated by dm/gfx/tools/shader_split.py, do not edit): vertex key <TAB> pixel key
|
||||
|
@@ -0,0 +1 @@
|
||||
# Answer table for translation queries (generated by dm/gfx/tools/shader_split.py, do not edit): key <TAB> fact JSON. No PC shader pairing supplied: only the thread group / shared memory of compute shaders (taken from the control section); other queries get the translator defaults
|
||||
|
@@ -0,0 +1,22 @@
|
||||
# kind: evidence The Binding of Isaac: Rebirth shaders (GLSLC in RomFS + main) → control section + code area keys (dm/gfx/tools/shader_split.py)
|
||||
# column 5 records where each key first appears; no PC shader pairing supplied
|
||||
package index stage dm_ctl_sha16 source
|
||||
ps_other.bin 0 pixel 8b6227e68ba96e1b /glslc_capture/1881ecf4c29656d4.glslc#GLSLC@0x0
|
||||
ps_other.bin 1 pixel d48a29200efe0442 /glslc_capture/1b930ec1200a9f7b.glslc#GLSLC@0x0
|
||||
ps_other.bin 2 pixel 94d3a46798b91027 /glslc_capture/2607998f9867a42f.glslc#GLSLC@0x0
|
||||
vs_other.bin 0 vertex 2f40d0d204672252 /glslc_capture/3cbe9421aa41d805.glslc#GLSLC@0x0
|
||||
vs_other.bin 1 vertex 1554a979ff3249c7 /glslc_capture/415a9ae028cba582.glslc#GLSLC@0x0
|
||||
ps_other.bin 3 pixel 41e078ba80c2b223 /glslc_capture/41a72744086e3ffb.glslc#GLSLC@0x0
|
||||
ps_other.bin 4 pixel 196fa5ee57a17cbb /glslc_capture/5b93d4dc15a7719d.glslc#GLSLC@0x0
|
||||
vs_other.bin 2 vertex d6b297d6e00900bc /glslc_capture/661aa947b5179be7.glslc#GLSLC@0x0
|
||||
ps_other.bin 5 pixel ab064f1c8b317af2 /glslc_capture/838be4b64368f698.glslc#GLSLC@0x0
|
||||
vs_other.bin 3 vertex c8d4c2fff8a91023 /glslc_capture/972303a3585fdcbd.glslc#GLSLC@0x0
|
||||
ps_other.bin 6 pixel 839563c8e270b794 /glslc_capture/977cde09a59d2a6e.glslc#GLSLC@0x0
|
||||
ps_other.bin 7 pixel a61a82830c29ff06 /glslc_capture/bff66df774ce92ad.glslc#GLSLC@0x0
|
||||
vs_other.bin 4 vertex 085d495fbd125c79 /glslc_capture/c3c5b1959cc52017.glslc#GLSLC@0x0
|
||||
ps_other.bin 8 pixel f8c8d55af8d5324a /glslc_capture/cb294501cb3a07fa.glslc#GLSLC@0x0
|
||||
vs_other.bin 5 vertex 4b10090ca4947349 /glslc_capture/cd85c2b66cd39a15.glslc#GLSLC@0x0
|
||||
vs_other.bin 6 vertex 9f6d3b3a0024581c /glslc_capture/e080a961a09b4f8b.glslc#GLSLC@0x0
|
||||
vs_other.bin 7 vertex f1fe2d6932030220 /glslc_capture/eae8bc3f8a4ae2cd.glslc#GLSLC@0x0
|
||||
ps_other.bin 9 pixel eb35ddc4c04b0e39 /glslc_capture/f6e1cbc22ed74d25.glslc#GLSLC@0x0
|
||||
vs_other.bin 8 vertex 8062ae7b88cef0c0 /glslc_capture/fc7996e13dfdf8e8.glslc#GLSLC@0x0
|
||||
|
@@ -0,0 +1,2 @@
|
||||
# kind: evidence control-section key conflict rulings: empty
|
||||
dm_ctl_sha16 chosen_pc class candidates records
|
||||
|
@@ -0,0 +1,19 @@
|
||||
# kind: evidence vertex / pixel shader pairs within BNSH variations (generated by dm/gfx/tools/shader_split.py, do not edit): vertex key <TAB> pixel key
|
||||
085d495fbd125c79 41e078ba80c2b223
|
||||
085d495fbd125c79 839563c8e270b794
|
||||
1554a979ff3249c7 41e078ba80c2b223
|
||||
1554a979ff3249c7 839563c8e270b794
|
||||
2f40d0d204672252 41e078ba80c2b223
|
||||
2f40d0d204672252 839563c8e270b794
|
||||
4b10090ca4947349 41e078ba80c2b223
|
||||
4b10090ca4947349 839563c8e270b794
|
||||
8062ae7b88cef0c0 41e078ba80c2b223
|
||||
8062ae7b88cef0c0 839563c8e270b794
|
||||
9f6d3b3a0024581c 41e078ba80c2b223
|
||||
9f6d3b3a0024581c 839563c8e270b794
|
||||
c8d4c2fff8a91023 41e078ba80c2b223
|
||||
c8d4c2fff8a91023 839563c8e270b794
|
||||
d6b297d6e00900bc 41e078ba80c2b223
|
||||
d6b297d6e00900bc 839563c8e270b794
|
||||
f1fe2d6932030220 41e078ba80c2b223
|
||||
f1fe2d6932030220 839563c8e270b794
|
||||
|
@@ -0,0 +1,9 @@
|
||||
# Fresh save: skip the opening, title, file 1, New Run, Isaac; stand in the starting room.
|
||||
save new
|
||||
keys f300:A,f420:A,f540:A,f660:A,f780:A
|
||||
secs 45
|
||||
quick 35
|
||||
reach 1800@35
|
||||
window 25 10
|
||||
shots 25,33
|
||||
hang 15
|
||||
|
@@ -64,6 +64,7 @@ One row per profile; the notes are each profile's `README.md`.
|
||||
| [Bayonetta](010076F0049A2000/README.md) | `010076F0049A2000` | 1.1 | 3.6.0 | PlatinumGames' engine (Wii U form) | NVN |
|
||||
| [Bayonetta 2](01007960049A0000/README.md) | `01007960049A0000` | 1.2 | 3.6.0 | PlatinumGames' engine (Wii U form) | NVN |
|
||||
| [Bayonetta 3](01004A4010FEA000/README.md) | `01004A4010FEA000` | 1.2.0 | 13.3.2 | PlatinumGames' engine | NVN |
|
||||
| [The Binding of Isaac: Rebirth](01009BC00C38A000/README.md) | `01009BC00C38A000` | 1.0 (base) | 5.5.0 | its own engine | NVN |
|
||||
| [Big Brain Academy: Brain vs. Brain](0100620012D6E000/README.md) | `0100620012D6E000` | 1.2.0 | 11.4.3 | NintendoWare Bezel Engine 1.56 | NVN |
|
||||
| [Blasphemous](0100698009C6E000/README.md) | `0100698009C6E000` | 1.0.8 | 8.3.1 | Unity 2017.4.28f1 IL2CPP, FMOD | NVN |
|
||||
| [Blasphemous 2](010040801A4C8000/README.md) | `010040801A4C8000` | 1.0.8 | 15.3.2 | Unity 2021.3.20f1 IL2CPP, FMOD | NVN |
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// Generated file (dm/gfx/tools/dmsh_chain.py --header): the B shader library translation chain version this source tree expects (default options), one for every game;
|
||||
// the host loads only <library dir>/b-<V>/. Run dmsh_chain.py --header after changing the chain's tools and commit this file with the change
|
||||
#define DMSH_CHAIN "3ae08e02ec6a"
|
||||
#define DMSH_CHAIN "5ee7c6407a57"
|
||||
@@ -85,7 +85,7 @@ class BlendZero(unittest.TestCase):
|
||||
self.assertTrue(re.search(r'\n dm_blend0\(out, dm_blend\);\n return out;\n\}$', b)) # the last line is still the return other stages look for
|
||||
self.assertEqual(e['params'][-1], PARAM)
|
||||
self.assertEqual(e['args'].split(', ')[-1], 'dm_blend')
|
||||
self.assertLess(out.index('struct main0_out'), out.index('void dm_blend0(main0_out& dm_o')) # the helper takes the struct: after it, before main0
|
||||
self.assertLess(out.index('struct main0_out'), out.index('void dm_blend0(thread main0_out& dm_o')) # the helper takes main0's local output: after its struct, before main0
|
||||
self.assertLess(out.index('void dm_blend0('), out.index('fragment main0_out main0('))
|
||||
|
||||
def test_each_float4_colour_by_its_index(self):
|
||||
@@ -164,12 +164,13 @@ class BlendZero(unittest.TestCase):
|
||||
u, info = dmsh_side.unit(text)
|
||||
f, meta = dmsh_fetch.fold(u, [], om_only_ok=True)
|
||||
texts += [(name, text), (name + '_unit', u), (name + '_fold', f)] # each text a library is compiled from
|
||||
for name, out in texts:
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
p = Path(d) / f'{name}.metal'; p.write_text(out)
|
||||
r = subprocess.run(['xcrun', '-sdk', 'macosx', 'metal', '-c', '-O1', '-fpreserve-invariance', '-fwrapv', str(p), '-o', str(Path(d) / f'{name}.air')],
|
||||
capture_output=True, text=True)
|
||||
self.assertEqual(r.returncode, 0, name + ': ' + r.stderr[:500])
|
||||
for sdk, flags in (('macosx', ()), ('iphoneos', ('-mios-version-min=18.0', '-fmetal-math-mode=relaxed'))):
|
||||
for name, out in texts:
|
||||
with self.subTest(sdk=sdk, variant=name), tempfile.TemporaryDirectory() as d:
|
||||
p = Path(d) / f'{name}.metal'; p.write_text(out)
|
||||
r = subprocess.run(['xcrun', '-sdk', sdk, 'metal', '-c', '-O1', '-fpreserve-invariance', '-fwrapv', *flags, str(p), '-o', str(Path(d) / f'{name}.air')],
|
||||
capture_output=True, text=True)
|
||||
self.assertEqual(r.returncode, 0, name + ': ' + r.stderr[:500])
|
||||
|
||||
|
||||
# t_blend_zero.m's shader: NaN, +Inf, -Inf and 2 by column, at alpha 0 (columns 0-3) and alpha 1 (4-7), with the guard
|
||||
|
||||
@@ -526,7 +526,7 @@ static inline __attribute__((always_inline)) float4 dm_bz(float4 c, uint m)
|
||||
if (!((m == 1u && c.w == 0.0f) || (m == 2u && c.w == 1.0f))) return c;
|
||||
return float4(select(c.xyz, float3(0.0f), (as_type<uint3>(c.xyz) & uint3(0x7f800000u)) == uint3(0x7f800000u)), c.w); // NaN or Inf by its bits: fast math may assume there is none
|
||||
}
|
||||
static inline __attribute__((always_inline)) void dm_blend0(main0_out& dm_o, constant dm_blend_state& dm_s)
|
||||
static inline __attribute__((always_inline)) void dm_blend0(thread main0_out& dm_o, constant dm_blend_state& dm_s)
|
||||
{
|
||||
uint m = dm_s.zero;
|
||||
if (m == 0u) return;
|
||||
|
||||
@@ -929,6 +929,7 @@ One line per symptom in the [subsystem references](../reference/): what you see
|
||||
- a simulation or filter that reads neighbouring texels misbehaves though every constant is right. In the translated MSL a variable is declared with no value and read at once (`int _139; int _141 = _139;`), used as a coordinate. On Ocarina of Time: grass whose blades shift at 10 Hz, with a 6-frame cycle in the depth buffer and a wind velocity texture of strong stripes. → [Dead-code removal dropped a coordinate of a multi-output instruction](../reference/shaders.md#dead-code-removal-dropped-a-coordinate-of-a-multi-output-instruction)
|
||||
- the ground kept stale 32×32 blocks where the G-buffer draw failed the depth test: blocks of a stale image where a depth pre-pass and a later pass with other vertex shaders meet (Odyssey: 32×32 blocks on every fourth frame). With mesh shaders: white shapes on plants for single frames, at other places each frame while the leaves move (Ocarina of Time). → [Position invariance across shaders](../reference/shaders.md#position-invariance-across-shaders)
|
||||
- white clouds over the ground, coming and going (Ocarina of Time: over the ground mist between Kokiri Forest and Hyrule Field, and over the ferns at the camera in Kokiri Forest while they sway). The scene target holds NaN pixels after a fog or lighting pass and bloom spreads each into a white blot; dropping that pass removes them. → [A NaN colour under a zero blend weight](../reference/shaders.md#a-nan-colour-under-a-zero-blend-weight)
|
||||
- iOS pixel shader compilation fails with `reference type must have explicit address space qualifier` at `dm_blend0(main0_out& dm_o, ...)`. The Mac libraries compile. → [The blend helper's output reference on iOS](../reference/shaders.md#the-blend-helpers-output-reference-on-ios)
|
||||
- dark specks flickering in a ground mist, a few pixels each, at different places every frame (Ocarina of Time in Kokiri Forest; the console shows none). Dropping the mist removes them, as does dropping its depth-only pass. → [gl_FragCoord.z against the depth stored for its own surface](../reference/shaders.md#gl_fragcoordz-against-the-depth-stored-for-its-own-surface)
|
||||
- making a pipeline archive prints `Max Unstruct ID 758 in function agc.main in shader 13941 exceeds supported limit`, and one pipeline takes many minutes, in `metal-tt` offline or in the host's prebuild on the device (`Preparing pipelines` holding one count for minutes). The line is a note, not an error: `metal-tt` goes on, exits 0 and writes that pipeline into the archive. → [Front end at -O1: Apple's control-flow lowering](../reference/shaders.md#front-end-at--o1-apples-control-flow-lowering)
|
||||
- the shader build prints `fatal error: bracket nesting level exceeded maximum of 256` and `<key>.metal: does not compile`, and the shader is left out. → [Bracket nesting past the front end's 256](../reference/shaders.md#bracket-nesting-past-the-front-ends-256)
|
||||
|
||||
@@ -773,6 +773,13 @@ Finding, keying and translating shaders (`dm/gfx/tools/shader_split.py`, `dmsh_b
|
||||
- **Open:** a NaN or Inf already in the target under a zero destination weight, and a non-finite weight on a colour of 0, which a shader cannot see; the alpha channel's own weights; the Vulkan and OpenGL shader paths (whether those drivers set the option is not known).
|
||||
- **Note:** found with `DM_NVN_SNAPRAW` and `DM_NVN_TEXSNAP` (raw floats of every colour target after chosen passes of one frame) and `DM_NVN_MAGSCAN`, then the one shader instrumented beside the library (`DM_MSL_DIR`): the first NaN at `1/w × v` with `w = 0`, every NaN texel stored with alpha 1 (source alpha 0). Ruled out on the way: the fog volumes (finite), FMZ handling (none in the code), stale uniforms (`DM_NVN_UB_DEFER=0`, `DM_NVN_UBP_CHECK`), the depth test, `-fmetal-math-mode=relaxed`. The driver's command word was found by scanning the modules for writes to method 0x670; the code that sends the list was not disassembled, and no console was measured.
|
||||
|
||||
### The blend helper's output reference on iOS
|
||||
|
||||
- **Symptom:** iOS pixel shader compilation fails with `reference type must have explicit address space qualifier` at `dm_blend0(main0_out& dm_o, ...)`. The Mac libraries compile.
|
||||
- **Cause:** `blend_zero` generated a reference without an address space. The iOS build targets Metal's iOS 18 language mode, which requires one; the Mac compiler's newer default accepts a generic reference. The output is a local variable of the fragment function.
|
||||
- **Fix:** `dmsh_rewrite.py` declares the helper's output parameter `thread main0_out&`. The helper's behavior is unchanged. `test_dmsh_blend_zero.py` compiles the plain, integer-output, side and readable-tile variants for both macOS and the packing script's iOS 18 target.
|
||||
- **Found on:** [The Binding of Isaac: Rebirth](../../dm/games/01009BC00C38A000/README.md): all 10 pixel shaders failed on iOS, while its 9 vertex shaders and all 19 Mac shaders compiled.
|
||||
|
||||
### gl_FragCoord.z against the depth stored for its own surface
|
||||
|
||||
- **Symptom:** dark specks flickering in a ground mist, a few pixels each, at different places every frame (Ocarina of Time in Kokiri Forest; the console shows none). Dropping the mist removes them, as does dropping its depth-only pass.
|
||||
|
||||
Reference in new issue
Block a user