Maxwell methods and macros observed

Method numbers are 3D engine (subchannel 0) word offsets, and macro calls are methods 0xe00 + 2*index.

MethodUse seen in NVN command memory
0x004-0x007puller semaphore address, payload and operation (release writes memory, acquire reads)
0x3e0, 0x68bwritten with zero (cache flush and no-op forms, no memory effect)
0x4ebwindow origin. Game A's queue tail changes it from 0 to 0x10 after the first submission
0x5f2, 0x5f6index buffer address (two words) and index type, before macro 38
0x6c0-0x6c3query address, sequence and report operation
0x701, 0x702, 0x7c0, 0x7c1vertex stream 0 start address and inclusive end
0x8e0-0x8e3constant buffer size, address and write offset
0x8e4-0x8f3constant buffer data
0x904 + 8*stageconstant buffer bank bind (0x904 vertex, 0x924 fragment)
MacroMethodObserved meaning
70xe0eIMMD call with the shader stage, at the start of BindTexture: selects the stage's constant buffer (size from scratch 0xd2f + stage, address from 0xd2a + stage) for the handle written next
80xe10blend enables of the eight render targets from bits 8-15 of its argument, after a zero to 0x671
90xe12the eight render targets' color masks (0x680-0x687), two 13-bit halves per argument
120xe18program bind, five arguments. Selector 1 writes VertexB's code offset, 5 the fragment's, and the third argument is the offset (game B MME trace)
160xe20sets a constant buffer write offset in words: 0x154 before a storage descriptor upload of three 0x8e4 words landed at bank 0 + 0x550. In game B it began at word 0xfe of the uploaded MME program
250xe32DrawArrays (mode, first, count)
27, 370xe36, 0xe4ainstanced draw: topology, vertex count, instance count (masked by scratch 0xd1b), first vertex, base instance. 37 also writes the base instance into the bound constant buffer at 0x644
300xe3cinstanced indexed draw, game B's busiest macro: topology, index count, instance count (masked by 0xd1b), first index, base vertex, base instance
350xe46writes scratch 0xd38-0xd39, then 0x0d8-0x0d9, from two arguments and scratch 0xd3a
280xe38DrawElements (mode, index address high and low, index type, count)
26, 290xe34, 0xe3aDrawArraysIndirect and DrawElementsIndirect of NVN 55.15 (one game): after macro 16 with 0x190 (bank 0 + 0x640), the mode and the record, which the driver splices into the pushbuffer from its GPU address. A capture of the Maxwell path showed the record's base instance at bank 0 + 0x644. nvn's indirect draws give the vertex program BaseVertex and BaseInstance there (DrawCall.params)
380xe4cthe 12-word indexed draw in game B secondary lists: IMMD 0xe20 (value 0x190, the base vertex word), index type, index address, then six arguments. Packet word 10 (the fifth argument) is the base vertex

Slot numbers are game B's and those written by the studied functions. Another title's upload can number them differently. Register writes made inside a macro are not visible in the pushbuffer, so shader and constant buffer state cannot be inferred from direct writes alone.


Made from docs/layers/gpu/nvn.md at 69237645142c. GPL-3.0-or-later.