| 34 | } |
| 35 | |
| 36 | void SkinnedMeshDrawData::OnDataChanged(bool dropHistory) |
| 37 | { |
| 38 | // Setup previous frame bone matrices if needed |
| 39 | if (_hasValidData && !dropHistory) |
| 40 | { |
| 41 | ASSERT(BoneMatrices); |
| 42 | if (PrevBoneMatrices == nullptr) |
| 43 | { |
| 44 | PrevBoneMatrices = GPUDevice::Instance->CreateBuffer(TEXT("BoneMatrices")); |
| 45 | if (PrevBoneMatrices->Init(BoneMatrices->GetDescription())) |
| 46 | { |
| 47 | LOG(Fatal, "Failed to initialize the skinned mesh bones buffer"); |
| 48 | } |
| 49 | } |
| 50 | Swap(PrevBoneMatrices, BoneMatrices); |
| 51 | } |
| 52 | else |
| 53 | { |
| 54 | SAFE_DELETE_GPU_RESOURCE(PrevBoneMatrices); |
| 55 | } |
| 56 | |
| 57 | _isDirty = true; |
| 58 | _hasValidData = true; |
| 59 | } |
nothing calls this directly
no test coverage detected