History

Pull packBlendshapeOffsets() into separate function

Ken Cooke committed 7 years ago

Commit cceff211 parent 87c68031 file · +10 −9Browse files

Showing the changes to libraries/render-utils/src/Model.cpp (1 of 1 file). Show all

Unified · Split

libraries/render-utils/src/Model.cpp+10−9
@@ -1691,10 +1691,7 @@ public: · 1690 unmodified lines
1691 }1691 }
1692};1692};
1693 1693
1694 1694static void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) {
1695using packBlendshapeOffsetTo = void(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked);
1696
1697void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& packed, const BlendshapeOffsetUnpacked& unpacked) {
1698 float len = glm::compMax(glm::abs(unpacked.positionOffset));1695 float len = glm::compMax(glm::abs(unpacked.positionOffset));
1699 glm::vec3 normalizedPos(unpacked.positionOffset);1696 glm::vec3 normalizedPos(unpacked.positionOffset);
1700 if (len > 0.0f) {1697 if (len > 0.0f) {
@@ -1711,6 +1708,14 @@ void packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10(glm::uvec4& pac · 10 unmodified lines
1711 );1708 );
1712}1709}
1713 1710
1711static void packBlendshapeOffsets(BlendshapeOffsetUnpacked* unpacked, BlendshapeOffsetPacked* packed, int size) {
1712 for (int i = 0; i < size; ++i) {
1713 packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10((*packed).packedPosNorTan, (*unpacked));
1714 ++unpacked;
1715 ++packed;
1716 }
1717}
1718
1714class Blender : public QRunnable {1719class Blender : public QRunnable {
1715public:1720public:
1716 1721
@@ -1795,11 +1800,7 @@ void Blender::run() { · 78 unmodified lines
1795 // convert unpackedBlendshapeOffsets into packedBlendshapeOffsets for the gpu.1800 // convert unpackedBlendshapeOffsets into packedBlendshapeOffsets for the gpu.
1796 auto unpacked = unpackedBlendshapeOffsets.data();1801 auto unpacked = unpackedBlendshapeOffsets.data();
1797 auto packed = packedBlendshapeOffsets.data() + offset;1802 auto packed = packedBlendshapeOffsets.data() + offset;
1798 for (int i = 0; i < numVertsInMesh; ++i) {1803 packBlendshapeOffsets(unpacked, packed, numVertsInMesh);
1799 packBlendshapeOffsetTo_Pos_F32_3xSN10_Nor_3xSN10_Tan_3xSN10((*packed).packedPosNorTan, (*unpacked));
1800 ++unpacked;
1801 ++packed;
1802 }
1803 1804
1804 offset += numVertsInMesh;1805 offset += numVertsInMesh;
1805 }1806 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t