CGxDevice::SetVertexFormat
function · gx · orchestration
- Address
0x592aa0· 40 bytes, up to0x592ac7- Signature
void __thiscall (CGxDevice *this, void *buffer, uint32_t format)- Meaning
- Stores the format id, the bound buffer and the format's stride
- Confidence
- verified, proof one
- Finding
- gx/draw#vertex-formats
Finding: Vertex formats in gx: drawing
Thirteen formats are 16-byte records at 0x809c00: descriptor pointer, element count, stride, and a mask of components. Mask bit 0 is position (12 bytes), bit 3 normal (12), bit 4 colour (4, a packed dword), bit 5 first texture coordinate (8), bit 6 second (8); terrain/render#vertex-formats lists which formats the terrain code binds. 0x58a7c0(buffer, id) binds a buffer with format id: it sets the attribute mask (0x592a60, which also sets the dirty mask [dev+0x27dc] |= old ^ new), the format id and the stride (0x592aa0).
| id | stride | components |
|---|---|---|
| 0 | 0xc | position |
| 1, 2 | 0x18, 0x1c | position, normal; and colour |
| 3, 4 | 0x20, 0x24 | position, normal, texcoord 0; and colour |
| 5, 6 | 0x28, 0x2c | position, normal, texcoords 0 and 1; and colour |
| 7 | 0x10 | position, colour |
| 8, 9 | 0x18, 0x20 | position, colour, texcoord 0; and texcoord 1 |
| 10, 11 | 0x14, 0x1c | position, texcoord 0; and texcoord 1 |
| 12 | 0x30 | position, 4 bytes, 4 bytes, normal, texcoords 0 and 1 |
The derivation is in the doc.
Callers 1
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.