MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnDataChanged

Method OnDataChanged

Source/Engine/Graphics/Models/SkinnedMeshDrawData.cpp:36–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void 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}

Callers

nothing calls this directly

Calls 4

SwapFunction · 0.50
CreateBufferMethod · 0.45
InitMethod · 0.45
GetDescriptionMethod · 0.45

Tested by

no test coverage detected