No description
Find a file
Stephen Gutekanst aab99b5474 gpu: make requestDevice callback-based, add waitForDevice helper
Previously we were attempting to turn WebGPU async functions, which are
exposed by `webgpu.h` as callbacks, into Zig async functions.

This in practice turns out harder than expected. For example, `Buffer.mapAsync`
/ `wgpuBufferMapAsync` cannot easily be exposed as a Zig async function for a few
reasons:

1. The callback is merely guaranteed to be called once the buffer's content is ready to
   be accessed via `wgpuBufferGetMappedRange` - but there is no strict guarantee about
   when that is. It could be 1-3 frames later, in theory, I believe.
2. The non-deterministic timing means that one would wish to poll "has the async function
   returned?" but this isn't trivial without our own scheduler.
3. Zig has a fair amount of async rework in the future that is coming, and I imagine it
   will be one of the later things that is fully supported by the WebAssembly backend
   (but I am speculating) - so it seems wise to punt on this until later.

Instead, we are now retaining async functions as callback-based ones, with a helper in
this case to wait for the callback to be invoked. For `wgpuBufferMapAsync` we will just
have the callback approach.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 00:51:48 -07:00
.github CI: force uninstall of libx11 on x86_64-macos 2022-03-06 02:04:47 -07:00
dev dev: dont complain about unbound GITHUB_ACTIONS env var when pushing subrepos 2022-03-04 17:45:32 -07:00
ecs ecs: major rethink & database-aligned design 2022-01-27 22:54:26 -07:00
glfw glfw: CI: uninstall libx11 on x86_64-macos to avoid conflicts 2022-03-06 02:10:07 -07:00
gpu gpu: make requestDevice callback-based, add waitForDevice helper 2022-03-19 00:51:48 -07:00
gpu-dawn gpu-dawn: update to latest binary release 2022-03-09 03:44:25 +00:00
src glfw: add terminate function 2021-07-16 15:24:45 -07:00
.gitattributes initialize repository 2021-07-04 10:36:34 -07:00
.gitignore gitignore: update to latest from ziglang/zig repo 2021-07-06 20:51:19 -07:00
.gitmodules gpu-dawn: update to latest Dawn + windows patches 2022-03-04 19:54:06 -07:00
build.zig constify unmutated variables in build files 2021-11-22 12:59:11 -07:00
LICENSE LICENSE: note directories with a separate LICENSE file 2021-07-05 12:46:20 -07:00
LICENSE-APACHE initialize repository 2021-07-04 10:36:34 -07:00
LICENSE-MIT initialize repository 2021-07-04 10:36:34 -07:00
README.md README: add new website, Matrix chat room 2021-12-14 18:16:45 -08:00

Mach - Game engine & graphics toolkit for the future

Learn more at hexops.com/mach

Join the conversation

Our community exists on Matrix chat, join in and help build the future of game engines & graphics in Zig!

You can also follow @machengine on Twitter for updates.

⚠️ in-development ⚠️

Under heavy development, not ready for use currently.

Supported platforms

Mach is still incredibly early stages, so far we have support for building from the following OS to the following targets:

Building for From macOS x86_64 From macOS M1/aarch64 From Linux x86_64 From Windows x86_64
macOS x86_64
macOS M1/aarch64
Linux x86_64
Windows x86_64
iOS 🏃 🏃 🏃 🏃
Android 🏃 🏃 🏃 🏃
  • Tested and verified via CI.
  • ✔️ Should work, not tested via CI yet.
  • 🏃 Planned or in progress.
  • ⚠️ Implemented, but has known issues (e.g. bugs in Zig.)

Subrepositories / projects

Whether you're interested in using all of Mach, or just some parts of it, you get to choose. Our libraries all aim to have the same zero-fuss installation, cross compilation, and platform support:

  • mach-glfw: Ziggified GLFW bindings with 100% API coverage

Contributing

Mach is maintained as a monorepo. When changed are merged to this repository, we use some git fu to pick out the commits to subdirectories and push them ot sub-repositories. For example, commits to the glfw/ directory also get pushed to the separate mach-glfw repository after being merged here.

There are only two requirements:

  1. Pull requests to sub-repositories must be sent to this monorepo, not to the sub-repository itself - to avoid some annoying merge conflicts that can arise.
  2. Individual commits may not change multiple sub-repositories at the same time (e.g. a commit to glfw/ cannot also include changes to gpu/, to avoid confusion.)