CM2Shared::CreateIndexBuffer
function · models · primitive
- Address
0x71dab0· 459 bytes, up to0x71dc7a- Meaning
- Fills a shared model's device index buffer with its view's triangles for each instance copy
- Confidence
- verified, proof one
- Finding
- models/shared#device-buffers
Finding: Device buffers in models: the shared model
The buffers hold +0x15c copies of the selected view, one per instance of a batched draw; a load
sets it to 1, and drawing a batched run of n raises it to n rounded up to 16, at most +0x160,
and frees the buffers to be rebuilt. Per copy the vertex buffer holds the vertices the view's lookup
names, in lookup order, 48 bytes each, their bone index bytes replaced by the view's palette bytes
plus copy · bones. Per submesh and copy the index buffer holds the submesh's triangle entries plus
copy · lookup count with shader ids, else the copy's vertex offset less the submesh's first
vertex; the submesh copy in +0x158 gets its run's start.
The derivation is in the doc.
Callers 2
- M2DrawBatch models
- M2DrawBatchedRun models
Callees 6
- 0x589f80 gx
- 0x58a010 gx
- GxBufLock gx
- GxBufUnlock gx
- 0x58a160 gx
- PassBufferToDevice gx
Calls and jumps by a bare address, from tables/calls.tsv.