[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] WebVulkan



The problem seems to be that Vulkan is multi-threadable, but not multi-processable, and that it can't share contexts across processes. This is compounded by the fact that UAs have decided that JS won't get threads and that rendering happens in a dedicated process.

There are several ways this can be addressed:
  1. Make Vulkan multi-processable, this should really have been done from the start.
  2. Make Vulkan share its context across processes
  3. For each Vulkan context, create a "Vulkan Worker", which hosts a JS interpreter, and the Vulkan context (and give JS in that worker process the ability to multithread)
  4. Move the Vulkan context into the main JS process/tab
These are solvable problems, and memory-mapping shouldn't be avoided in JS because it's scary. It isn't. You just make sure the memory is properly initialized to 0 prior to handing it to JS, just the same as you do with ordinary array buffers. GPUs do implement memory region isolation as well, and if Vulkan does not (which I highly doubt), that's something to fix as well.