`webgpu.h` does not expose a method of choosing the GPU backend (vulkan, opengl, opengles, etc.) at present. The only way to achieve this is to use Dawn's C++ API, which we expose as C shims under the `machDawnNative*` prefix. For now, we will use the Dawn adapter creation API so that we can choose between Vulkan/OpenGL/OpenGLES etc via the `GPU_BACKEND` env var. In the future, I believe we can do something nicer here. For example, perhaps we extend our `requestAdapter` method (after all, we do not need to strictly match `webgpu.h`) to take such an option and be Dawn-aware so that it handles this more seamlessly behind the scenes. Fixes https://github.com/hexops/mach/issues/192#issuecomment-1080895255 Signed-off-by: Stephen Gutekanst <stephen@hexops.com> |
||
|---|---|---|
| .. | ||
| c.zig | ||
| main.zig | ||
| sample_utils.zig | ||