Hello, I started to use Flex 1.1 and had the following issues.
I create a Flexlibrary instance and a Solver with Compute11 flag.
Function works when using a buffer created with host, but when trying to pass a Direct3D11 Buffer using
NvFlexRegisterD3DBuffer some are working, some throw an access violation:
I used either Default/Staging structured buffers for the tests (and made sure that size is big enough in every case.
If needed I can provide repro
the following work passing a Direct3D Buffer
NvFlexGetActive
NvFlexGetParticles
NvFlexGetPhases
NvFlexGetSmoothParticles
the following ones throw an access violation
NvFlexGetVelocities
We will take a look at this and try to repro this here. One issue may be that the structured buffers would need to have the expected layout, e.g.: float3 for velocities, int32 for active set, etc.
I made sure that for velocities buffers are set to float3 indeed (I actually tried both with float3 float4, but I generally made sure buffers are large enough too, since CopySubresourceRegion should normally be ok with buffer description .
Please note I’m using 64 bits version (I did not try 32 bits), both debug and release give the same errors
I tried with all type of buffers (raw/vertex/staging) and the methods that works do with any type (as long as NvFlexRegisterD3DBuffer elemetncout/stride is set accordingly.
Also NvFlexGetSprings in that case does not crash, but does not copy back any data.
I also have NvFlexGetNormals that gets me an Access violation as well (I made sure to use float4 in that case, copying back on an Host buffer was no problem).
Also speaking about Direct3D11 interop, I was curious if it would be possible to use :
NvFlexUpdateDistanceField by passing a Volume texture at some point (Since I guess it gets copied into one anyway, but in my use cases a lot of my distance fields are already generated in compute shader, so that would save a round trip)
In case of NvFlexUpdateTriangleMesh I guess the bounding volumes are done on cpu so it’s probably a non option.