How to update triangle meshes in Flex every game frame...

Hello,

I am trying to update the position of vertices at every frame for a properly constructed triangle mesh constructed with NvFlexCreateTriangeMesh() and updated with NvFlexUpdateTriangleMesh() (See docs https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/flex/_static/api/_nv_flex_8h.html#a4958c555f0ed65dee54c37af32529356

Every works perfectly if I create and update my triangle mesh ONCE during construction but I get CUDA errors 4 in ‘cudaMemcpyAsync’ when I try to call NvFlexUpdateTriangleMesh{} during the update frame.

I have tried shifting my per-frame call to NvFlexUpdateTriangleMesh() at different times relative to per-frame Flex pull-from-GPU, modify structures, push-to-GPU but nothing works.

Q1: Can triangle meshes have their vertices updated once a frame?

Q2: If so, when can I update?

Q3: What memory flag do I use? (Host, HostAsync, Device, DeviceAsync)

Many thanks for any clue you might have… grasping at straws for days!!

Daniel,

Figured it out thanks. Problem is I was feeding a bad pointer into it! Arg!!! :)