benilla-re systems structs docs

s_shaderLevelCounts

global · gx

Address
0x809d90 · 8 bytes, up to 0x809d97
Type
uint32_t[2]
Meaning
Holds the count of level offsets in a shader file's table by target: 6 vertex, 12 pixel
Confidence
verified, proof one
Finding
gx/slots#shader-files

Finding: Shader files in gx: the device's virtual slots

A shader file starts with a magic dword, SVXG for vertex shaders and SPXG for pixel shaders, the version 0x10003, one dword the loader skips, and a table of file offsets: 6 for vertex and 12 for pixel shaders, one per program level. The device takes the offset at its level for the target (+0x2d0 vertex, +0x2d4 pixel), seeks there and has each shader read its code, then marks it loaded (+0x2c = 1) and clears +0x34. A negative level, a missing file, a wrong magic or version, or an offset of 0 loads nothing.

The derivation is in the doc.