compile wasm failed

I follow guide to compile build-vtk-wasm, use master branch, but i got this error:

vtkWebGPURenderWindow.cxx:197:29: error: no member named ‘Undefined’ in ‘wgpu::BackendType’
case wgpu::BackendType::Undefined:

and soon on like this:

vtkWebGPURenderWindow.cxx:217:11: error: no member named ‘backendType’ in ‘wgpu::RequestAdapterOptions’
options.backendType = this->RenderingBackendType;

i can compile success when switch branch to tag-9.3, but it lost some function i need, like ‘SetInputArray’

auto reader = vtkXMLUnstructuredGridReader::New();

here is build command:

emcmake cmake
-G “Ninja”
-S ./src
-B ./build-vtk-wasm

cd ./build-vtk-wasm

in addition, i didn’t use docker, i compile in local.


oh, i solved that problem, because i use emscripten version 3.1.38 before. it not show error after i update to latest version of 3.1.49

Glad you were able to solve it. The WebGPU rendering classes in VTK are experimental because webgpu C API is continuously being developed. Such change in struct definitions are to be expected for a while.