benilla-re systems structs docs

CGxDeviceOpenGl::PatchVertexProgram

function · gx · primitive

Address
0x59e800 · 609 bytes, up to 0x59ea60
Signature
void __thiscall (CGxDeviceOpenGl *this, void *program)
Meaning
Rebinds a vertex program's local PARAM constants to program.env in place and rewrites c31 as a range
Confidence
verified, proof one
Finding
gx/renderstate#opengl-vertex-program-constants

Finding: OpenGL vertex program constants in gx: render state

Before an OpenGL vertex program is built, its text is rewritten in place. Each declaration PARAM c<n> or PARAM c<n>[<m>] bound to = { program.local or = program.local is bound to program.env instead, padded with two spaces to keep the length. The declaration of c31 is then replaced whole by PARAM c31[N−31]={program.env[31..N−1]}, N being the device's vertex constant count [dev+0x2d8], followed by ; and spaces up to the line's end. A program whose fields +0x40 or +0x4c hold an untagged pointer is left alone. Nothing bounds the rewrite of c31 by the length of the line it replaces.

The derivation is in the doc.

Callers 1

Callees 2

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