These should typically not be stored across multiple frames, since dispatch order might differ.
| 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 | { |