MCPcopy Create free account
hub / github.com/defold/defold / AcquirePoseMatrixCacheEntry

Function AcquirePoseMatrixCacheEntry

engine/rig/src/rig.cpp:1430–1456  ·  view source on GitHub ↗

These should typically not be stored across multiple frames, since dispatch order might differ.

Source from the content-addressed store, hash-verified

1428
1429 // These should typically not be stored across multiple frames, since dispatch order might differ.
1430 HCachePoseMatrixEntry AcquirePoseMatrixCacheEntry(HRigContext context, HRigInstance instance)
1431 {
1432 if (instance == 0)
1433 {
1434 return INVALID_POSE_MATRIX_CACHE_ENTRY;
1435 }
1436 else if (instance->m_PoseMatrixCacheIndex != INVALID_POSE_MATRIX_CACHE_ENTRY)
1437 {
1438 return instance->m_PoseMatrixCacheIndex;
1439 }
1440
1441 PoseMatrixCache* cache = &context->m_PoseMatrixCache;
1442
1443 uint16_t next_index = cache->m_CacheEntryOffsets.Size();
1444 if (cache->m_CacheEntryOffsets.Full())
1445 {
1446 cache->m_CacheEntryOffsets.OffsetCapacity(32);
1447 }
1448
1449 cache->m_CacheEntryOffsets.SetSize(next_index + 1);
1450
1451 instance->m_PoseMatrixCacheIndex = next_index;
1452
1453 cache->m_CacheEntryOffsets[next_index] = cache->m_TotalPoseCount;
1454 cache->m_TotalPoseCount += instance->m_BindPose->Size();
1455 return next_index;
1456 }
1457
1458 uint32_t GetPoseMatrixCacheDataOffset(HRigContext context, HRigInstance instance)
1459 {

Callers 2

TEST_FFunction · 0.85
CompModelUpdateFunction · 0.85

Calls 4

SizeMethod · 0.45
FullMethod · 0.45
OffsetCapacityMethod · 0.45
SetSizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.68