Skip to content

chain: NVN2 image handles from a register, c2's table and memory (image pool) - #2616

Open
FifteenPen wants to merge 4 commits into
seedds:mainfrom
FifteenPen:pr/nvn2-image-handles
Open

FifteenPen wants to merge 4 commits into
seedds:mainfrom
FifteenPen:pr/nvn2-image-handles

Conversation

@FifteenPen

Copy link
Copy Markdown
Contributor

NVN2 image handles the translator couldn't trace, found on The Duskbloods network test:

  • chain/ampere: SULD and SUST through a handle in a register (0x998, 0x99c) now translate. Before, those accesses were dropped.
  • host/nvn: an image the shader picks from c2's table at run time binds as a 32-entry slot array, where element k is image slot k (profile key tex_dyn_slots, as for textures).
  • chain/translator: an image whose handle the shader loads from memory (the fog volume, GXFogVolume_*, reads its 3D image handle from storage buffer 0) can't be a slot array, because the index is the image ID itself. It now indexes an image pool by ID: a new reflection kind, img_pool, gets a table filled by the replay with the bound images (the write sink elsewhere). Without it the fog volume was never written and the world drew black behind the HUD. Covered by test_dmsh_pool_arrays.py.
  • chain: dmsh_xlate rebuilt (native tools, arm64 + x86_64), with the lock and the chain header.

…99c)

The bindless forms of the formatted surface load and store: the handle in Rc, as Maxwell's SULD.D.B / SUST.D.B, which BindlessElimination resolves. The Duskbloods' compute shaders use them 724 times in 227 shaders (all formatted, a channel mask at 72..76, 40..59 zero); with them its 1,957 shaders translate, and 131 accesses in 33 shaders are still dropped where the handle cannot be traced. Not in this commit: the native translator rebuilt from this source, dmsh_chain.lock and dmsh_chain.h (the native build here links Homebrew OpenSSL and brotli, unlike the committed binary; tested with a managed build of the translator).
…lot arrays, element k = image slot k (tex_dyn_slots)
…indexes an image pool by its ID, so The Duskbloods' fog volume is written
@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts) shader chain The shader translation chain (DMSH_CHAIN): a change rebuilds every game's shaders labels Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) shader chain The shader translation chain (DMSH_CHAIN): a change rebuilds every game's shaders tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant