benilla-re systems structs docs

CGxDeviceD3d::GetTextureLevels

function · gx · primitive

Address
0x5a0880 · 173 bytes, up to 0x5a092c
Signature
void __thiscall (CGxDeviceD3d *this, void *texture, uint32_t *width, uint32_t *height, uint32_t *first, uint32_t *end)
Meaning
Sets the first level, the end level and the top level size of a texture from its flags and the device's skip count
Confidence
verified, proof one
Finding
gx/texlevels#direct3d-level-range
Test
gx::d3d_texture_levels_difftest

Finding: Direct3D level range in gx: texture levels

0x5a0880(tex, &width, &height, &first, &end), with the device in ecx, gives the levels the Direct3D device creates and uploads: first to end - 1, the top one width by height. A texture whose filter mode (flag bits 0 to 2) is 0 or 1, or whose flag bit 6 is set, with bit 5 clear has one level at full size: first 0, end 1. Any other has floor(log2(max(width, height))) + 1 levels; first is the device's skip count [dev+0x31c] held to the last level, both sides shift right by it, and bit 5 makes end first + 1, else end is the level count. A texture 0 by 0 on the chain never returns.

The derivation is in the doc.

Callers 2

Callees 0

None by a direct call or jump.

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