Disclaimer: Please do not confuse the “web” with JavaScript. The goal is to use pure C webgpu header/implementations on desktop AND support web applications through webassembly
Last year, we added experimental webgpu backend in VTK for rendering polydata. You can read more about it here- https://www.kitware.com/vtk-webgpu-on-the-desktop/. The primary goal was to speed up rendering of really large number of actors and it was actually 1.6x faster than VTK’s OpenGL rendering subsystem.
In this post, I want to summarize the current status of webgpu desktop in VTK C++ and provide a listing of the action items planned for the rest of the year.
In VTK,
- The code lives in the VTK::RenderingWebGPU module.
- This module provides factory overrides for
vtkRenderWindow
,vtkRenderer
,vtkActor
,vtkPolyDataMapper
, etc. - An up to date guide of how to build VTK with Dawn is documented here VTK::RenderingWebGPU - VTK documentation.
- It works on linux using X11 for window system and in a web browser with webassembly.
- There is no CI for webgpu.
Action Item | Status |
---|---|
Use webgpu-native headers | To be done in 2024 |
Dynamically load webgpu implementation at runtime | To be done in 2024 |
WSI - x11 + vtkHardwareWindow | To be done in 2024 |
WSI - macos + vtkHardwareWindow | To be done in 2024 |
WSI - windows + vtkHardwareWindow | To be done in 2024 |
WSI - html5 (emscripten) + vtkHardwareWindow | To be done in 2024 |
WSI - wayland + vtkHardwareWindow | Future work |
WSI - ios + vtkHardwareWindow | Future work |
WSI - android + vtkHardwareWindow | Future work |
WSI - wasi (wasi-webgpu) + vtkHardwareWindow | Future work |
Shader customizations | To be done in 2024 |
Compute shaders | To be done in 2024 |
Volume rendering | Looking for funding |
Speed up frustum culling with compute shader | To be done in 2024 |
Speed up polygon tessellation with compute shader | To be done in 2024 |
CI infrastructure with established webgpu implementations | To be done in 2024 |
**: WSI=Window System Integration
**: @sankhesh took a stab at using webgpu-native headers and improving WSI support in vtk/vtk!10239
**: wasi= WebAssembly System Interface is a specification which tells how wasm can be used outside a web browser. wasi-webgpu is being designed here - GitHub - WebAssembly/wasi-webgpu
These items are tracked in the master issue here - vtk/vtk#19315
Cc: @tom.clabault @lgivord @Thomas_Galland @sankhesh @cory.quammen @Francois_Mazen