Games that use NVN take the NVN path. The loader takes the game's NVN functions at nvnBootstrapLoader and the
nvnDeviceGetProcAddress it returns: each name's dispatch slot holds the runtime's handler (gpu/nvn/nvn.hook), so
no driver code past its lookup runs, and the driver never sets nvnPrivate0, which would send the game's inlined NVN
code to write command memory itself. A game's first NVN call reads its NVN API version, and the log says whether the
runtime has measured layouts for it. The runtime runs the calls either way.
An earlier tree decoded the Maxwell pushbuffers that the game's driver wrote (a GPFIFO decoder, the 3D, compute, 2D,
copy and inline-to-memory engines, and the macro engine with native macros and an LLVM compiler of macros). That path
was removed. A Maxwell front end without the macro HLE and the macro compiler came back in src/nx/gpu/maxwell/ for
programs that write their own command buffers (OpenGL games, homebrew), which submit them with SUBMIT_GPFIFO on
/dev/nvhost-gpu. It interprets every macro. It sees no work of an NVN game, because the game's NVN driver writes no
command memory. A disassembly study of the
command-buffer functions found how little each call writes on the console:
| Call | Words written |
|---|---|
nvnCommandBufferDrawArrays | 4: one MME macro call, header 0xa0030e32, then mode, first, count |
nvnCommandBufferDrawElements | 6: header 0xa0050e38, then mode, index address high and low, index type, count |
nvnCommandBufferBindTexture | 4 or 5 (game A): an IMMD macro call 0x80000e0e | table[stage] << 16 (a per-stage value from an SDK table), 0x8000068b when the command buffer's byte +0x6c is set, then 0x200208e3, id*8 + 0x20, handle |
tests/support/nvn_control.c decodes the arguments of two macros and nvn_command_gap.c classifies what methods
write, both checked against packets captured in their tests.
Made from docs/layers/gpu/nvn.md at 69237645142c. GPL-3.0-or-later.