samdauwe / webgpu-native-examples

Collection of C-language examples that demonstrate basic rendering and computation in WebGPU native.
Apache License 2.0
373 stars 21 forks source link

Compilation error #8

Closed geminax closed 1 year ago

geminax commented 1 year ago

Failing to compile on Linux Mint 21.1

/webgpu-native-examples/src/webgpu/shader.c: In function ‘wgpu_create_shader_module_from_wgsl’:
/webgpu-native-examples/src/webgpu/shader.c:115:6: error: ‘WGPUShaderModuleWGSLDescriptor’ has no member named ‘source’
  115 |     .source = source,
      |      ^~~~~~
make[2]: *** [CMakeFiles/wgpu_sample_launcher.dir/build.make:328: CMakeFiles/wgpu_sample_launcher.dir/src/webgpu/shader.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1510: CMakeFiles/wgpu_sample_launcher.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

did something change with latest Dawn?

samdauwe commented 1 year ago

Hi Alex,

thanks for reporting this issue. You are correct, there were some changes in Dawn recently that broke the compilation. WGPUShaderModuleWGSLDescriptor 'source' property has been renamed to 'code' property resulting in the error you got while compiling.

I also did some other fixes related to the latest Dawn changes. Could you try if the fixes resolve the compilation errors on your side ?

In case you see any other issue or have any feedback for improvement / example that needs to be added, feel free to let me know.

With best regards, Sam

geminax commented 1 year ago

Thanks, the latest changes are now compiling. 👍