fabmax / physx-js-webidl

Javascript WASM bindings for Nvidia PhysX
MIT License
119 stars 28 forks source link

Profile & Debug builds #2

Closed lucas-jones closed 3 years ago

lucas-jones commented 3 years ago

What's thoughts on also including Profile & Debug builds in the dist folder?

fabmax commented 3 years ago

I don't have any experience in debugging wasm code and always assumed there aren't any useful tools to do that. Therefore I didn't see the point in providing such builds.

However, apparently there are ways to do that so adding debug builds seems to be a good idea.

lucas-jones commented 3 years ago

If I remember correctly a WASM Debug/Profile build shows the C++ function name when running a CPU profiling via Chrome Profiler. Also PhysX debug builds include stuff for the PhysX VisualDebugger (Can use websockify to then use it via browser)

https://gameworksdocs.nvidia.com/PhysX/4.1/documentation/physxguide/Manual/VisualDebugger.html

fabmax commented 3 years ago

Alright, I added wasm binaries for debug and profile builds (in dist-debug/ and dist-profile respectively).

However, I haven't yet added any web-idl bindings to Pvd stuff, as that requires a bit more work and I'm quite busy at the moment :/

lucas-jones commented 3 years ago

Ace. I'll try giving it a go & pull-request

nidin commented 2 years ago

@lucas-jones Hey, did you manage to send data to PVD from the browser?

lucas-jones commented 2 years ago

Yes. Just proxying the data via websockify.

Make sure you're using a profile build.

websockify 8090 127.0.0.1:5425

https://gist.github.com/lucas-jones/3b62e0ff621b27555be3d15782b59518

pvdPvd = PhysX.PxTopLevelFunctions.CreatePvd(PhysicsSystem.foundation);
const pvdTransport = createPhysXDebugger();
pvdPvd.connect(pvdTransport, new PhysX.PxPvdInstrumentationFlags(PhysX.PxPvdInstrumentationFlagEnum.DEBUG));

Use this to create the pvdTransport, which you have to pass in a PhysX somewhere - can't remember exactly

nidin commented 2 years ago

Thanks for the quick reply. I will give it a try 👍