diff options
| author | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
| commit | ca32c59a58d37c1822e185a2d5f3d0d3e8943593 (patch) | |
| tree | b06b9eec03f34344ef8fc31aa147b2714d3962ee /NvCloth/src/dx/DxFactory.cpp | |
| parent | Forced rename of platform folders in cmake dir. Git didn't pick this up before. (diff) | |
| download | nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.tar.xz nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.zip | |
NvCloth 1.1.4 Release. (24070740)
Diffstat (limited to 'NvCloth/src/dx/DxFactory.cpp')
| -rw-r--r-- | NvCloth/src/dx/DxFactory.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/NvCloth/src/dx/DxFactory.cpp b/NvCloth/src/dx/DxFactory.cpp index 91f5125..7298ffe 100644 --- a/NvCloth/src/dx/DxFactory.cpp +++ b/NvCloth/src/dx/DxFactory.cpp @@ -96,6 +96,12 @@ typedef Vec4T<uint32_t> Vec4u; , mCollisionPlanesDeviceCopy(mContextManager) , mCollisionTriangles(mContextManager, DxStagingBufferPolicy()) , mCollisionTrianglesDeviceCopy(mContextManager) + , mVirtualParticleSetSizes(mContextManager, DxStagingBufferPolicy()) + , mVirtualParticleSetSizesDeviceCopy(mContextManager) + , mVirtualParticleIndices(mContextManager, DxStagingBufferPolicy()) + , mVirtualParticleIndicesDeviceCopy(mContextManager) + , mVirtualParticleWeights(mContextManager, DxStagingBufferPolicy()) + , mVirtualParticleWeightsDeviceCopy(mContextManager) , mMotionConstraints(mContextManager) , mSeparationConstraints(mContextManager) , mRestPositions(mContextManager, DxStagingBufferPolicy()) @@ -205,7 +211,7 @@ void cloth::DxFactory::extractFabricData(const Fabric& fabric, Range<uint32_t> p if (!sets.empty()) { - // need to skip copying the first element + // we don't skip first element here NV_CLOTH_ASSERT(sets.size() == dxFabric.mSets.size()); memcpy(sets.begin(), dxFabric.mSets.begin(), sets.size() * sizeof(uint32_t)); } @@ -390,8 +396,11 @@ void cloth::DxFactory::extractFabricData(const Fabric& fabric, Range<uint32_t> p uint32_t numWeights = cloth.getNumVirtualParticleWeights(); Vector<PxVec4>::Type hostWeights(numWeights, PxVec4(0.0f)); - copyToHost(hostWeights.begin(), dxCloth.mVirtualParticleWeights.mBuffer.mBuffer, 0, - hostWeights.size() * sizeof(PxVec4)); + //copyToHost(hostWeights.begin(), dxCloth.mVirtualParticleWeights.mBuffer.mBuffer, 0, + // hostWeights.size() * sizeof(PxVec4)); + NV_CLOTH_ASSERT(hostWeights.size() == dxCloth.mVirtualParticleWeights.size()); + intrinsics::memCopy(hostWeights.begin(), DxCloth::MappedVec4fVectorType(const_cast<DxCloth&>(dxCloth).mVirtualParticleWeights).begin(), + destIndices.size() * sizeof(uint32_t)); // convert weights to Vec3f PxVec3* destIt = reinterpret_cast<PxVec3*>(destWeights.begin()); @@ -408,8 +417,11 @@ void cloth::DxFactory::extractFabricData(const Fabric& fabric, Range<uint32_t> p uint32_t numIndices = cloth.getNumVirtualParticles(); Vector<Vec4us>::Type hostIndices(numIndices); - copyToHost(hostIndices.begin(), dxCloth.mVirtualParticleIndices.mBuffer.mBuffer, 0, - hostIndices.size() * sizeof(Vec4us)); + //copyToHost(hostIndices.begin(), dxCloth.mVirtualParticleIndices.mBuffer.mBuffer, 0, + // hostIndices.size() * sizeof(Vec4us)); + NV_CLOTH_ASSERT(hostIndices.size() == dxCloth.mVirtualParticleIndices.size()); + intrinsics::memCopy(hostIndices.begin(), DxCloth::MappedVec4usVectorType(const_cast<DxCloth&>(dxCloth).mVirtualParticleIndices).begin(), + destIndices.size() * sizeof(uint32_t)); // convert indices to 32 bit Vec4u* destIt = reinterpret_cast<Vec4u*>(destIndices.begin()); |