38 Q_DISABLE_COPY(QSSGRenderMotionVectorMap)
40 struct MotionResultData {
41 QMatrix4x4 prevModelViewProjection;
42 QMatrix4x4 prevInstanceLocal;
43 QMatrix4x4 prevInstanceGlobal;
44 QSSGRenderImageTexture prevBoneTexture;
45 QSSGRenderImageTexture prevInstanceTexture;
46 QSSGRenderImageTexture currentMorphWeightTexture;
47 QSSGRenderImageTexture prevMorphWeightTexture;
51 ~QSSGRenderMotionVectorMap();
55 const QMatrix4x4 ¤tModelViewProjection,
56 const QMatrix4x4 ¤tInstanceLocal,
57 const QMatrix4x4 ¤tInstanceGlobal,
58 QSSGRenderTextureData *currentBoneTextureData,
59 QSSGRenderInstanceTable *currentInstanceTable,
60 const QVector<
float> ¤tMorphWeights);
62 void releaseCachedResources();
65 struct MotionStoreData {
66 QMatrix4x4 prevModelViewProjection;
67 QMatrix4x4 prevInstanceLocal;
68 QMatrix4x4 prevInstanceGlobal;
69 std::shared_ptr<QSSGRenderTextureData> prevBoneTextureData;
70 std::shared_ptr<QSSGRenderTextureData> prevInstanceTextureData;
71 std::shared_ptr<QSSGRenderTextureData> currentMorphWeightTextureData;
72 std::shared_ptr<QSSGRenderTextureData> prevMorphWeightTextureData;
73 QSize lastPrevBoneTextureDataSize;
74 QSize lastPrevInstanceTextureDataSize;
75 QSize lastPrevMorphWeightTextureDataSize;
76 QSize lastCurrentMorphWeightTextureDataSize;
81 QHash<
const void*, MotionStoreData> m_cache;
83 void cleanupStaleEntries();
84 void releaseEntryResources(MotionStoreData& entry);
85 QSSGRenderImageTexture loadAndReleaseIfNeeded(
const std::shared_ptr<QSSGRenderTextureData>& textureData, QSize lastSize);
MotionResultData trackMotionData(const void *modelKey, const QMatrix4x4 ¤tModelViewProjection, const QMatrix4x4 ¤tInstanceLocal, const QMatrix4x4 ¤tInstanceGlobal, QSSGRenderTextureData *currentBoneTextureData, QSSGRenderInstanceTable *currentInstanceTable, const QVector< float > ¤tMorphWeights)