|
|
|
|
|
by thethirdone
2646 days ago
|
|
I was under the impression that the main benefit of Vulcan was reduced CPU overhead and allow multithreading for GPU related code. It seems like pairing it with node negates most of that advantage. Is that an accurate assumption? If it is, why use a vulkan api rather than an OpenGL or WebGL api? |
|
Multi-threading is possible with SharedArrayBuffers [0] and N-API allows to take the memory address of it. NVK is only a thin layer above Vulkan and JavaScript <-> C++ interopability is pretty fast. You only notice some overhead when making thousands of calls, because the C++ code cannot be inlined. But again, this is not something common in Vulkan.
Also JavaScript doesn't have essential features like Compute shaders for years now. Vulkan has all of it. Even though WebGPU [1] is in development, I don't expect it to give access to the Vulkan RTX pipeline anytime soon.
[0] SharedArrayBuffer: https://v8docs.nodesource.com/node-4.8/d4/db8/classv8_1_1_sh...
[1] WebGPU: https://github.com/gpuweb/gpuweb