benilla-re systems structs docs

CGxDevice::LoadShaderFile

function · gx · primitive

Address
0x595130 · 270 bytes, up to 0x59523d
Signature
void __thiscall (CGxDevice *this, CGxShader **shaders, uint32_t target, const char *name, uint32_t count)
Meaning
Reads shaders from a shader file at the offset for the device's program level of the target
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.

Callers 3

Callees 4

Calls and jumps by a bare address, from tables/calls.tsv.