CGxDeviceOpenGl::ApplyStageTexture
function · gx · orchestration
- Address
0x59d020· 115 bytes, up to0x59d092- Signature
void __thiscall (CGxDeviceOpenGl *this, uint32_t stage, void *texture)- Meaning
- Binds a texture to a stage through its target and applies its sampler and mip upload state, or unbinds it
- 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 1
Callees 4
- 0x594d90 gx
- CGxDeviceOpenGl::SetCachedState gx
- CGxDeviceOpenGl::BindTexture gx
- CGxDeviceOpenGl::UploadTexture gx
Calls and jumps by a bare address, from tables/calls.tsv.