Repository navigation
Texture pool tables hold a view of a texture read through another layered type, so cube maps read by handle are no longer zero and PRAGMATA's Cabin shows his face in the Shelter - #2534
Conversation
…nother layered type, so cube maps read by handle are no longer zero and PRAGMATA's Cabin has his face A texture pool table gave an ID only a texture of the table's Metal type. The host keeps cubes and cube arrays as 2D arrays, so every cube read through a cube table sampled the dummy, and PRAGMATA's Character_CabinDisplay material, which samples 2D sprites through a texture2d_array table, drew Cabin's monitor black. The read bitmap gets one section per table type, so the host knows through which type a shader read an ID; a table of another layered type then holds the view fit_layers gives (2D <-> 2D array, cubes <-> 6n layers), cached per ID and dropped with its views. Reads no view serves keep the dummy and are reported once per ID as [RED] [pool-type]. Test: t_pool_typebridge. Co-authored-by: uncraftablexd <352372032+uncraftablexd@users.noreply.github.com>
…nother layered type, so cube maps read by handle are no longer zero (PR #2534) A texture pool table gave an ID only a texture of the table's Metal type. The host keeps cubes and cube arrays as 2D arrays, so every cube read through a cube table sampled the dummy, and PRAGMATA's Character_CabinDisplay material, which samples 2D sprites through a texture2d_array table, drew Cabin's monitor black. The read bitmap gets one section per table type, so the host knows through which type a shader read an ID; a table of another layered type then holds the view fit_layers gives (2D <-> 2D array, cubes <-> 6n layers), cached per ID and table type and dropped with the ID's views. One view per type: a table stands over submissions while nothing is registered, so a texture read through two other types (a cube as 2D and as a cube, a cube array as a cube and as a cube array) keeps the view each table holds. Reads no view serves keep the dummy and are reported once per ID as [RED] [pool-type]. Test: t_pool_typebridge (10 of 32 checks fail without the bridge, 2 with one view per ID). Co-authored-by: computerguy526 <355510486+computerguy526@users.noreply.github.com> Co-authored-by: uncraftablexd <352372032+uncraftablexd@users.noreply.github.com>
|
Landed on main as 3852186, with you and uncraftablexd as co-authors. Thanks for the diagnosis, the reach table and the test. Changes on top of yours:
Not run: a regression run (no game had libraries for the current shader chain), and PRAGMATA in game with the per-type views. A retest of Cabin's face and the reflections on main would be welcome. |
|
Retested on main with your per-type views. Cabin's face and the reflections are right. Setup: M4 Pro, macOS 26.6.2. The host is main 9ccbd6b (3852186, 529cf68 and 529c5fa all included) plus our PRAGMATA branch's local patches: the open #2509 and #2477, our sparse/residency safety and the pipeline-archive fixes. The shader library was rebuilt for the new chain from the DLC-inclusive split: 36,779 shaders, all ok. Played on the Mac by the user.
Co-authored with UncraftableXD. |
|
Also checked Ocarina of Time (Switch 2) on main with the per-type views. Setup: M4 Pro, macOS 26.6.2. Host is main 9ccbd6b plus our local OoT patches, library rebuilt for that chain. Walk/camera routes on three saves (Kakariko, the Kokiri Forest mist and foliage path, Hyrule Field), timed runs interleaved against our previous play setup, 15 runs in all.
Co-authored with UncraftableXD. |
|
A follow-up to the OoT note above: the 20 to 250 Co-authored with UncraftableXD. |
Related to the PRAGMATA bring-up, ccd834e (@seedds).
In PRAGMATA's Shelter, Cabin's monitor stays black; on console it shows an animated cyan face: rounded eyes, a smile,
^ ^when greeting, the CABIN SYSTEM logo, the stamp grid. Every cube map the game reads by handle samples zero, which removes environment reflections and light everywhere. No[RED]line points at either.Both come from the texture pool tables (
pool_gpu). There is one table per element type a shader declares, andpool_entry/pool_seen_scangave a table only textures of its own Metal type. To Maxwell 2D, 2D-array, cube and cube-array textures are all layers, and each texture instruction carries its own dimension. The host keeps cubes and cube arrays as 2D arrays and makes cube views only for slot binds (tex_fit). So:Character_CabinDisplay(fragment shaderecd01ea9b68f5390), samples its five sprite slots through atexture2d_arraytable. The sprites (Ch06000FaceMonitorUserData'sfms*.tex, 256x256 BC7) are 2D textures, so the face read zero. The game sets the sprites and their animated parameters every frame; the draw itself is fine.Reach (pool element types in the translated libraries, counted from their reflection):
What changes (
nvn_mtl.m, for every game)dm_pool_mark) has one section per table type, and a table's head names its own section (pool_seen_gpu_t). 2D tables keep the bitmap's start, so a game that reads only 2D tables marks exactly as before.g_seen_typed,pool_seen_t), so it knows through which type a shader read an ID.pool_fit: a table of another layered type holds a view of the ID's texture when a shader read the ID through that type. The view uses the layersfit_layersgives, made from the root texture astex_fitdoes for a slot:palt), apart from the slot binds'alt, so the two do not take turns. It goes with the ID's views (treg_drop_views) and is rebuilt when the ID's texture changes. An ID first read through a second type is written into the existing tables in place (pool_seen_scan), as a first read is.tex_fitbinds for a slot; GL and Vulkan leave such a read undefined. Each such ID read is reported once:[RED] [pool-type] texture ID … is Metal type X, read through a type Y texture pool table: left out (dummy), at most 256 a run.Tests
t_pool_typebridge(new, Metal validation, encoder thread off and on, 30 checks):texture2d_array,texture2d,texturecube,texturecube_arrayhandles);main's rule (no table holds another type), 8 of its checks fail: the 2D sprite, the cube, the 6-layer cube and the cube array read the dummy, and the GPU reads zero.t_pool_standin(3 modes),t_pool_notes,t_pool_seen_replace,t_pool_retire,t_cube_placeholderandt_tex_fit_rootpass. They use 2D tables, whose bitmap section is the one they write.ci_local.sh --full, this commit merged intomain8d44aaf): host tests,t_tex, the gfx tests build, CPU-only gfx tests, TSan, ASan/UBSan, thermal, gl-imports, Metal lock,dmhostfor the three profiles, the iOS compile check and build smoke all pass. The lint-c and tool-test failures are already onmain8d44aaf: lint-c's findings are in files this change does not touch, andtest_tree_tarfails there too. lint-python is skipped because no Python file changed.Regression
regress.py impact HEAD~1..HEADlists The Legend of Zelda: Breath of the Wild, Pokémon Scarlet and The Legend of Zelda: Tears of the Kingdom as affected, through any change tonvn_mtl.m. Hades is broad (present path). None was run.Co-authored with UncraftableXD.