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
Open
computerguy526 wants to merge 1 commit into
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>
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.
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.