remove bone component cache to decrease memory consumption

caching this is entirely unnecessary, as it changes every frame
This commit is contained in:
Ricardo Luís Vaz Silva 2025-01-26 17:25:27 -03:00
commit 3d2f9e06ed
22 changed files with 79 additions and 113 deletions

View file

@ -74,6 +74,7 @@ void BoneBuffer::Clear()
int BoneBuffer::UploadBones(const TArray<VSMatrix>& bones)
{
Map();
int totalsize = bones.Size();
if (totalsize > (int)mMaxUploadSize)
{
@ -90,10 +91,12 @@ int BoneBuffer::UploadBones(const TArray<VSMatrix>& bones)
if (thisindex + totalsize <= mBufferSize)
{
memcpy(mBufferPointer + thisindex * BONE_SIZE, bones.Data(), totalsize * BONE_SIZE);
Unmap();
return thisindex;
}
else
{
Unmap();
return -1; // Buffer is full. Since it is being used live at the point of the upload we cannot do much here but to abort.
}
}