NV3 RAMIN

From NvWiki
Revision as of 13:13, 30 June 2025 by Starfrost (talk | contribs) (Created page with "'''Instance memory''' (<code>RAMIN</code>, sometimes <code>PRAMIN</code>) is an area of VRAM where structures for objects to be operated on by the GPU are placed. It does not use traditional VRAM addressing, but instead uses its own addressing method which is fairly peculiar; at a high level, it is basically addressed in reverse, but in 16-byte increments; within those 16 bytes the addressing is done in a traditional order. RAMIN addresses can be converted to VRAM addres...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Instance memory (RAMIN, sometimes PRAMIN) is an area of VRAM where structures for objects to be operated on by the GPU are placed. It does not use traditional VRAM addressing, but instead uses its own addressing method which is fairly peculiar; at a high level, it is basically addressed in reverse, but in 16-byte increments; within those 16 bytes the addressing is done in a traditional order. RAMIN addresses can be converted to VRAM addresses using the following formula:

    addr &= (vram_max - 1);
    addr ^= (vram_max - 0x10);
    addr >>= 2; // what

Or expressed in a more linguistic way:

real VRAM address = VRAM_size - (ramin_address - (ramin_address % reversal_unit_size)) - reversal_unit_size + (ramin_address % reversal_unit_size) 

where reversal_unit_size is equal to 16.