Share GPU skinning palette per instance; push it once per change
Render3DDraw/HardwareBatch hold the SDK's shared palette instead of copying 16 floats per bone per draw, and HardwareScene re-pushes the uniform only when the palette pointer changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1eccdc87d7
commit
837ccc2f31
@@ -52,7 +52,6 @@ struct Render3DDraw {
|
||||
command.indices.clear(); command.indices.shrink_to_fit();
|
||||
command.bone_indices.clear(); command.bone_indices.shrink_to_fit();
|
||||
command.bone_weights.clear(); command.bone_weights.shrink_to_fit();
|
||||
command.bone_matrices.clear(); command.bone_matrices.shrink_to_fit();
|
||||
command.geometry = std::make_shared<const Render3DDraw>(std::move(source));
|
||||
return command;
|
||||
}
|
||||
@@ -83,7 +82,7 @@ struct Render3DDraw {
|
||||
// Skeletal skinning streams
|
||||
std::vector<std::uint8_t> bone_indices; // 4 uint8 per vertex
|
||||
std::vector<float> bone_weights; // 4 floats per vertex
|
||||
std::vector<float> bone_matrices; // 16 floats per bone (palette)
|
||||
std::shared_ptr<const std::vector<float>> palette; // GPU skinning, 16 floats per bone; shared per instance
|
||||
|
||||
// Render states
|
||||
bool z_enable = true;
|
||||
|
||||
Reference in New Issue
Block a user