benilla-re systems structs docs

CGxDeviceOpenGl::ApplyTextureParams

function · gx · orchestration

Address
0x59f170 · 250 bytes, up to 0x59f269
Signature
void __thiscall (CGxDeviceOpenGl *this, void *texture)
Meaning
Sets a texture's OpenGL filters, wrap, mip generation and anisotropy from its flags word
Confidence
verified, proof one
Finding
gx/renderstate#stage-sampler-state

Finding: Stage sampler state in gx: render state

Binding a texture to a stage (ids 0x17 to 0x1e) also sets the stage's sampler from the texture's flags word (textures.md, Texture flags word). Direct3D (0x5a29d0) sets the texture, then magnification, minimisation and mip filters from the table 0x85c7d8 by the low three bits, ADDRESSU and ADDRESSV from bits 3 and 4 (0x80a254: clear CLAMP 3, set WRAP 1), and MAXANISOTROPY from bits 9 to 13. OpenGL (0x59f170) sets GL_TEXTURE_MAG_FILTER and MIN_FILTER from 0x80a01c and 0x80a004, wrap from bits 3 and 4 (GL_REPEAT when set, GL_CLAMP_TO_EDGE or GL_CLAMP when clear), mip generation from bit 6 and anisotropy from bits 9 to 13.

The derivation is in the doc.

Callers 3

Callees 0

None by a direct call or jump.

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