Driver offsets

The sdk module's .text loads at 0xbd0c000 with no offset, so a game address A is sdk offset A - 0xbd0c000.

Functionsdk offset
nvnProgramSetShaders0x5bf8a0 (a thunk that sets x3 to 0, then 0x5bf8b0)
nvnProgramSetShadersExt0x5c03f0
nvnProgramBuilderSetShaders0x5c09d0
nvnProgramInitializeFromBuilder0x5c1730
nvnCommandBufferPushGraphicsConstants0x5d34b0

A shader data entry is {data, control} (16 bytes) for SetShaders and for the builder alike: the program's GPU address, then the control section's CPU address. nvnProgramInitializeFromBuilder reads the builder's array as SetShaders reads its own. A program's control sections lie 0xd8 bytes apart.

Push constants write table | offset << 8 to method 0x141 of the 3D or compute engine (SET_ROOT_TABLE_SELECTOR), and the words to 0x142 (LOAD_ROOT_TABLE). The driver passes the API's offset, in bytes, and it cuts a push at 256 bytes, a table's size. Programs read the eight tables as banks 24 to 31, which the renderer binds as one uniform buffer (SNX_VKB_ROOT). Variable rate shading writes the shading rate image and palette (next section). SetGeometryProcessingMode writes method 0xe26.


Made from docs/platforms/nx/ounce.md at 69237645142c. GPL-3.0-or-later.