I can get WebGPU to work fine with the release candidate 9.4.0. I am little puzzled, why you require “-sASYNCIFY” to be used. I would prefer the calls to be blocking, e.g. GetRenderWindow().
I am working on establishing a better debug, but currently I ran into some memory if build with threading (32-bit).
I am using your most recent docker images. Your 32-bit works fine, the 32-bit with threading gives me the memory out of bounds at startup. I can see that WebGPU is found and the adapter information.
Any hints are welcome. If not, I will work on establishing a better debugging setup.
Simple answer is that webgpu (unlike webgl2) is async only. This has a contagious effect, requiring everything else (even embind funcs to become async)
This looks like a static initialization issue. Cpp call stack with line numbers would definitely be helpful.
I realized that and changed a bunch of JavaScript code to handle the async nature. I will try tomorrow to get it to run in debug, so I get the callstack. I agree, it seems like an initialization issue. In debug mode, I got a some trace…
Tomorrow, I will try to establish a setup for debugging. I managed to do this before, but only for debugging my own code and the code from Emscripten.
I figured it out. It was a simple out-of-memory. If I set the initial memory size, -sINITIAL_MEMORY=1GB, it went away. It was in the creation of a vtkBuffer, perhaps I should double check if we allocate memory here without handling out-of-memory properly.
Ah. Glad you figured it out. I vaguely recall seeing similar callstack not long ago that said table index was out of bounds. I’ll have to update the vtk emscripten docs page with this info.
I did an interesting find. Random access to points and computing distances to a fixed point. I did this to investigate -msimd128 and it turns out that no vectorization is made unless points are on a 16-byte boundary. Therefore invented a vtkScaledAOSDataArray (with padding). More interesting even without SIMD, the aligned memory is twice as fast as non-aligned memory. It has a significant impact reading less memory.