Commit graph

414 commits

Author SHA1 Message Date
Stephen Gutekanst
1df13d0509 glfw: update system_sdk to match latest Zig master macOS version targeting
The latest Zig master supports specifying a specific macOS version for libc, via
the target triple (ziglang/zig#10215):

* x86_64-macos.10 (Catalina)
* x86_64-macos.11 (Big Sur)
* x86_64-macos.12 (Monterey)
* aarch64-macos.11 (Big Sur)
* aarch64-macos.12 (Monterey)

Mach's `system_sdk.zig` can now download the relevant XCode framework stubs
for Big Sur (11) and Monterey (12). Although we don't have an SDK for Catalina (10)
currently, we use the Big Sur (11) SDK in that case and it generally works fine.
By default, Zig targets the N-3 version (e.g. `x86_64-macos` defaults to `x86_64-macos.10`).

Targeting the minimum supported version is useful for compatability, it guarantees the produced
binary will run on any later macOS version. Targeting the newer version can be useful if you
wish to use newer APIs not available in previous versions.

Fixes hexops/mach#102

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-27 00:15:15 -07:00
Stephen Gutekanst
f91ceef291 glfw: support building with latest Zig master
This removes a linker hack which was preventing building with the latest
Zig master version. Of particular note, anyone wishing to use this library
will need to ensure they are up to date with latest master.

The binary releases available at https://ziglang.org/download/ (1783+eec825c and
beyond) are sufficient (really, anything released after today.)

Fixes hexops/mach#103

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-26 22:29:58 -07:00
InKryption
7b9b0469cb glfw: un-hardcode constant
Make the constant extracted from GLFW source into `time.setTime`, into a better-documented set of comptime instructions
2021-11-26 22:13:47 -07:00
InKryption
1d648c2256 glfw: Eliminate Error.InvalidValue 2021-11-26 20:50:38 -07:00
InKryption
683c60bdfe glfw: run zig fmt 2021-11-24 05:14:48 -07:00
InKryption
a6b30b98e2 glfw: add runtime assertion to Window.setInputMode
Assertion to ensure that the value of 'mode' matches the type of 'value'
2021-11-24 05:14:48 -07:00
InKryption
f9ecc8e1f8 glfw: Finalize removal of 'InvalidEnum' error 2021-11-24 05:14:48 -07:00
InKryption
fb0c695bd1 glfw: Eliminate InvalidEnum 2021-11-24 05:14:48 -07:00
InKryption
a465d2e021 glfw: add 'assertInitialized' 2021-11-23 12:12:55 -07:00
InKryption
c95bc37306 glfw: make comment into doc comment 2021-11-23 12:12:55 -07:00
InKryption
77eeadd407 glfw: update possible errors comment
Add 'FormatUnavailable' as a possible error to the 'getClipboardString' comment, which can set it on wayland
2021-11-23 11:07:14 -07:00
InKryption
6127fa267f glfw: re-instate prong
Bring back the 'c.GLFW_NOT_INITIALIZED' prong in 'convertError', such that if it is ever passed that error code, we can differentiate it from just an invalid input; because it is a valid input, we just guarantee that it won't occur.
2021-11-23 11:06:19 -07:00
InKryption
b35a7b4fad glfw: Change error unions into normal returns, in accordance with the new guarantee to never encounter 'GLFW_NOT_INITIALIZED', and update tests 2021-11-22 12:59:11 -07:00
InKryption
88e0d37325 glfw: enum-ify 'Joystick.jid', set 'InvalidEnum' as unreachable, and run zig fmt 2021-11-22 12:59:11 -07:00
InKryption
aae3ea8577 constify unmutated variables in build files 2021-11-22 12:59:11 -07:00
InKryption
d9e2505b59 glfw: amend and update various TODOs pertaining to force-init changes 2021-11-22 12:59:11 -07:00
InKryption
da392d89a7 glfw: assert initialized in proc address getter functions 2021-11-22 12:59:11 -07:00
InKryption
43b2502e3a glfw: fix for getClipboardString reaching unreachable prong on linux CI 2021-11-22 12:59:11 -07:00
InKryption
ef7ada052c glfw: Revert error denormalization 2021-11-22 12:59:11 -07:00
InKryption
44fee8f1f1 glfw: force init error type work around 2021-11-22 12:59:11 -07:00
InKryption
9f241b5109 glfw: Remove 'NotInitialized' error 2021-11-22 12:59:11 -07:00
InKryption
42f0d15584 glfw: force init in Window.zig 2021-11-22 12:59:11 -07:00
InKryption
76d2b8ad9f glfw: force init in vulkan.zig 2021-11-22 12:59:11 -07:00
InKryption
4e22d5811e glfw: force init in time.zig 2021-11-22 12:59:11 -07:00
InKryption
1c33e85af3 glfw: force init in opengl.zig 2021-11-22 12:59:11 -07:00
InKryption
fb115b79e5 glfw: force init in Monitor.zig 2021-11-22 12:59:11 -07:00
InKryption
526bff1d5b glfw: force init in Joystick.zig 2021-11-22 12:59:11 -07:00
InKryption
c90f879709 glfw: force init in key.zig 2021-11-22 12:59:11 -07:00
InKryption
c6310dc377 glfw: force init in main.zig 2021-11-22 12:59:11 -07:00
InKryption
de1e6391c6 glfw: force init in Cursor.zig 2021-11-22 12:59:11 -07:00
InKryption
fba8bb1cb2 glfw: force init in clipboard.zig 2021-11-22 12:59:11 -07:00
InKryption
400e86888b glfw: force init before using init dependent functions 2021-11-22 12:59:11 -07:00
Stephen Gutekanst
7d47233d7a glfw: patch GLFW sources to workaround a bug where Zig and Mach C headers conflict
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 12:31:55 -07:00
Stephen Gutekanst
ae39a840e8 glfw: update system_sdk to use latest MacOS 12.0 SDK
Updates us to using the newer SDK https://github.com/hexops/sdk-macos-12.0

Also enables cross-compilation of the `mach/gpu` backend for macOS.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 12:31:55 -07:00
Stephen Gutekanst
d5d78a2196 gpu: README: clarify Zig version requirements
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
efb7fe9c62 gpu: update dawn C shims to reflect library name
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
882e82f601 gpu: remove TODO about spirv-cross
Mozilla and Google both found SPIRV-Cross to be insufficient and built Naga and
Tint, respectively, so there's no need to support this build option.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
5ce69d0273 gpu: correct Force32 explanation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
4a76678a62 gpu: remove backend type constant debugging code
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
512da9ae9d gpu: build Null dawn backend
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
ab87f82382 gpu: polish README
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
484f768c0a webgpu: rename to just "gpu"
It's nicer to refer to this in code as `gpu`. Additionally, `webgpu` as a name
gives the impression this is for web only which is absolutely not true but could
understandably be very confusing to newcomers.

Solve both problems by renaming to just `gpu`, and (next) updating the README to
indicate what it does and why, then explain it's WebGPU after as more of an
implementation detail.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
ef1827a9a1 webgpu: install all dawn libs
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
0cf9f06177 webgpu: build tint into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
edb95b23c5 webgpu: build spirv-tools into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
b2ad2f4f21 webgpu: build dawn-utils into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
9793bb7de0 webgpu: build dawn-wire into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
698d4f6bc4 webgpu: build dawn-native into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
eb1936a98d webgpu: build dawn-platform into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
13d26d3587 webgpu: build dawn-common into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00