gr2: share vertex streams across tri-groups on the GPU skinning path

Each tri-group draw now references one shared geometry with a
first_index/index_count sub-range instead of copying the vertex
streams per group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-12 16:27:00 +09:00
co-authored by Claude Opus 5.5
parent e354b92e08
commit 9ec7fa10c0
2 changed files with 64 additions and 2 deletions
+4
View File
@@ -30,6 +30,10 @@ struct Gr2MeshDraw {
std::vector<float> uv0; // 2 floats (u, v) per vertex
std::vector<uint32_t> diffuse; // 0xAARRGGBB per vertex
std::vector<uint32_t> indices; // Triangle indices
// Sub-range of the indices (of geometry when shared) this draw covers. Tri-groups of one
// GPU mesh share a single geometry and differ only by range and material.
uint32_t first_index = 0;
uint32_t index_count = UINT32_MAX; // UINT32_MAX = through the end
// Skeletal skinning palette & vertex weights (for GPU skinning)
std::vector<uint8_t> bone_indices; // 4 uint8 per vertex