eliemichel / LearnWebGPU-Code

The accompanying code of the Learn WebGPU C++ programming guide
https://eliemichel.github.io/LearnWebGPU
MIT License
90 stars 23 forks source link

Not GLFW, using HTML OffscreenCanvas do multi-threads rendering? #40

Open xrui94 opened 1 month ago

xrui94 commented 1 month ago

There is an example for multi-threads rendering based on html OffscreenCanvas by calling wgpu-native?

eliemichel commented 1 month ago

I do not have such example, but if you do find one I'd be interested in having a look at it!

xrui94 commented 1 month ago

I do not have such example, but if you do find one I'd be interested in having a look at it!

Yes, I recently wrote a test demo that shows how to write C++ code and draw triangles using webgl and webgpu in the OffscreenCanvas, multi-threads environment. This is my project:

https://github.com/xrui94/test_webgl_webgpu_offscreencanvas

Note: Instead of wgpu-native and dawn, the webgpu implementation "webgpu_cpp. h" provided by emscripten was used in my test_webgl_webgpu_offscreencanvas project. If you want to see using wgpu-native to achieve the goals described in this issue, you can check out my another project: https://github.com/xrui94/iEngine. However, there are still some problems with this repository, and I am still looking for solutions. If you have a idea to help me solve them, then thank you very much.