Effectively a redo of hexops/mach#231 where I messed up the submodule update by accident.
Updates Dawn to latest revision as of 2022-04-18 c7b7b6def6
* Followed https://github.com/hexops/dawn/tree/main/mach#updating
* The UB issue should now actually get fixed (once CI builds the binary releases.)
* Verified example runs on macOS.
Helps hexops/mach#221
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Every library we want to link against is either provided by the Zig
toolchain or part of our SDK. Therefore, using pkg-config to link
against libraries on the host system is never what we intend.
To fix this, use linkSystemLibraryName() everywhere instead of
linkSystemLibrary() as the latter integrates with pkg-config while the
former just passes -lfoo to the zig compiler.
In combination with Zig commit 38d6e1d8a8 fixing an std.build bug,
this change fixes the linking of the necessary X11 libraries on my
x86_64 glibc based Void Linux system.
Some Linux distro's (e.g. Ubuntu) ship with wget but not curl by default. It's possible
to run into this if you don't use it a lot, e.g. in WSL under Windows - so produce an error
if `curl` is not installed.
Additionally, if the binary download fails, don't throw an entire stack trace to stdout.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
I'm not sure including the OS and libc version in download URLs makes much sense. It may
be useful to include them as metadata in the future alongside the release, but it seems
better to exclude these from the URL (especially so that others can download them from a
script without fear of them changing for non-Zig consumption.)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
clearer now:
```
$ zig build run-dawn-example -Dtarget=x86_64-linux
error: gpu-dawn binaries for x86_64-linux.3.16...5.10.81-musl not available.
error: -> open an issue: https://github.com/hexops/mach/issues
error: -> build from source (takes 5-15 minutes):
error: use -Ddawn-from-source=true or set `Options.from_source = true`
```
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
With this change, you do not even need to download the generated Dawn repository.
This reduces the download size substantially, as that repository is around 1.2G.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Dawn no longer uses spirv-cross for OpenGL backends:
a52abab38c
Hence, we no longer need to compile it.
Helps #124
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>