mach/gpu/examples
Stephen Gutekanst fbbb0b0ae0 gpu: use Dawn adapter creation API for now so that GPU_BACKEND selection works
`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>
2022-03-31 16:57:30 +00:00
..
c.zig gpu: add gpu-hello-triangle (dawn) example 2022-03-19 00:51:48 -07:00
main.zig gpu: fix Queue.submit commands parameter 2022-03-19 00:51:48 -07:00
sample_utils.zig gpu: use Dawn adapter creation API for now so that GPU_BACKEND selection works 2022-03-31 16:57:30 +00:00