Commit graph

3003 commits

Author SHA1 Message Date
Stephen Gutekanst
988b5c0da8 Revert "gpu-dawn: update to latest version origin/generated-2023-01-19.1674151689"
This reverts commit 858003f6e4.
2023-01-19 18:38:26 -07:00
Wrench[bot]
858003f6e4 gpu-dawn: update to latest version origin/generated-2023-01-19.1674151689
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-19 18:34:30 -07:00
Release automation
c694f50295 gpu-dawn: update to latest binary release 2023-01-18 18:15:58 +00:00
Wrench[bot]
4681425f56 all: update Zig to version 0.11.0-dev.1350+bbab4beda
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-18 10:34:40 -07:00
Stephen Gutekanst
0eaa56b4ad mach: platform/libmach: update to latest mach/core API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-17 09:49:40 -07:00
Stephen Gutekanst
a15b9bb5f6 mach: platform/wasm: correct return signature
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-17 09:49:40 -07:00
Stephen Gutekanst
02ba76a95b shaderexp: update to latest mach/core API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-17 09:49:40 -07:00
Stephen Gutekanst
8082228186 mach: eliminate heap allocation of Core
Prior to this change `mach.Core.init` would heap allocate the structure, returning `*Core`:

```zig
app.core = try mach.Core.init(allocator, .{});
```

This was obviously not ideal, but wasn't possible to eliminate before due to how Core was
entangled with the platform abstraction. Now that it has been removed, we can reduce Core
initialization to take a `*Core` to initialize. In practice this means initialization looks
something like this:

```zig
try mach.Core.init(&app.core, alloctor, .{});
```

Or more simply:

```zig
try app.core.init(allocator, .{});
```

And we eliminate the `*Core` allocation entirely in most cases.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-17 09:49:40 -07:00
Austin Rude
f54d584991 gpu: fix getting adapter propeties in example
Dawn now verifies the next chain is null, requiring this change. See
3c9d26a6 and the code review comments for more info.
2023-01-15 17:57:00 -07:00
Austin Rude
77341e2905 gpu: link glfw directly to gpu 2023-01-15 17:57:00 -07:00
Stephen Gutekanst
9d1c96ed0e gpu: improve SupportedLimits query example
`supported` is a better variable name because `supported.limits.foobar` is the actual
way it need be referenced, and `limits.limits.foobar` would be redundant.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-15 13:21:25 -07:00
Ali Chraghi
2fd8e876fd mach: re-create swapchain on vsync mode change 2023-01-15 09:45:17 -07:00
Release automation
24132ad4d9 gpu-dawn: update to latest binary release 2023-01-15 16:09:14 +00:00
Ali Chraghi
ac133f52af gpu-dawn: fix {linux,windows}->macos cross-compilation 2023-01-15 08:31:26 -07:00
Ali Chraghi
168a84805a ecs: saturated add
Fixes #409
2023-01-15 08:31:26 -07:00
Ali Chraghi
10d5f344e3 {glfw,mach}: remove dead code 2023-01-15 08:31:26 -07:00
Release automation
30d614c377 gpu-dawn: update to latest binary release 2023-01-14 19:47:46 +00:00
Ali Chraghi
8197b869bf system_sdk: update to latest revision 2023-01-14 12:12:00 -07:00
Ali Chraghi
9f6020e545 {gpu,gpu-dawn}: add X11 linkage back; update to latest WebGPU API 2023-01-14 12:12:00 -07:00
Ali Chraghi
8a15fcd694 gpu-dawn: update for building latest dawn 2023-01-14 12:12:00 -07:00
Ali Chraghi
a52c6e5f5c gpu: update interface to latest webgpu headers 2023-01-14 12:12:00 -07:00
Wrench[bot]
e4f2f08431
gpu-dawn: update to latest Dawn version (#656)
* gpu-dawn: update to latest version generated-2023-01-12.1673546526

Signed-off-by: Wrench[bot] <wrench@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-14 08:26:48 -07:00
Austin Rude
c02578721a gpu: Update example to latest zig/glfw
Update the mach/gpu only example to work with the latest zig and
recent glfw error handling changes.
2023-01-12 21:46:27 -07:00
Release automation
340e886e78 gpu-dawn: update to latest binary release 2023-01-12 18:43:13 +00:00
Ali Chraghi
3e51dc0581 ci: remove git install step 2023-01-12 10:51:16 -07:00
Ali Chraghi
a97a33334c {mach, gpu-dawn}: don't hardcode linux window manager to X11 2023-01-12 10:51:16 -07:00
Ali Chraghi
8a645fa1bf gpu-dawn: fix binary revision 2023-01-12 10:51:16 -07:00
Release automation
772071c095 gpu-dawn: update to latest binary release 2023-01-12 10:04:11 +00:00
Release automation
f990d6761b gpu-dawn: update to latest binary release 2023-01-12 09:36:21 +00:00
Wrench[bot]
a19dcbbc19 all: update Zig to version 0.11.0-dev.1268+0e66df209
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-12 02:05:33 -07:00
Ali Chraghi
9364c8b6c2 gpu-dawn: append -g0 when debug mode is disabled
most binaries size will be reduced to half now
2023-01-12 01:54:48 -07:00
Ali Chraghi
e6f8630ac6 wasmserve: fix compilation with latest zig 2023-01-12 01:54:48 -07:00
Ali Chraghi
9675bd662e gamemode: fix package path 2023-01-12 01:54:48 -07:00
Ali Chraghi
1d7cd4be80 mach: fundamental changes
- Core doesn't depend to `App` anymore
 - `setOptions` has replaced with some new functions (`setTitle`,
   `setSize`, etc)
   - and more
2023-01-12 01:54:48 -07:00
Lue
91a53807ab mach: fix outdated reference to glfw.Error 2023-01-10 20:52:41 -07:00
Lue
eed2be4591 glfw: refactor getError and related functions
`getError()` now returns a struct `Error` containing `error_code` and
`description`. Rationale: retrieving the error code with the previous
implementation of `getError()` caused `getErrorString()` to return
null (the reverse is also true). The new implementation allows both
values to be retrieved at once.

The previous `getError()` function has been renamed to
`getErrorCode()` to reflect the fact that it returns a simple Zig
error rather than the `Error` struct. The error set returned by
`getErrorCode()` is now named `ErrorCode` rather than `Error`.

The behavior of the `getError()` family of functions clearing the
stored error is unchanged. However, since all code that used
`defer glfw.getError() catch {}` to explicitly clear errors had to be
refactored, a new `glfw.clearError()` function that returns void is
now available to make this operation more explicit.

Additionally, `mustGetError()` is now `mustGetErrorCode()`, and new
functions `mustGetError()` and `mustGetErrorString()` have been added
which wrap `getError()` and `getErrorString()` but panic if no error
is actually available.

Tests and API documentation had to be refactored across all of
`mach/glfw`. This commit also takes the opportunity to skip tests
involving window creation on CI so that other tests may still execute
normally.
2023-01-10 20:52:41 -07:00
Release automation
779359a519 gpu-dawn: update to latest binary release 2023-01-10 09:35:27 +00:00
Stephen Gutekanst
a750e31d11 Revert "all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)"
This reverts commit a1fe671db8.

Lue suggested reverting #661 because ZLS worked around the issue of @src
being relative in that environment: https://github.com/zigtools/zls/pull/898

This is not a perfect solution (what zls did seems to be a workaround), but
is good enough for us until Zig gets an official package manager.
2023-01-10 01:57:52 -07:00
Wrench[bot]
7d246e76b3 all: update Zig to version 0.11.0-dev.1247+87b223428
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-08 18:21:50 -07:00
Stephen Gutekanst
cd236e8df7 glfw: README: update usage example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-08 18:21:11 -07:00
Stephen Gutekanst
2cd4ce12f2 mach: update to latest GLFW error handling approach
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-08 18:21:11 -07:00
Stephen Gutekanst
abb1077052 glfw: rework error handling system to prevent footguns
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-08 18:21:11 -07:00
apple
cf8922cc33
gpu: fix example build (#663) 2023-01-05 01:58:13 -07:00
Stephen Gutekanst
2271c78fd6 gamemode: fix compilation after build change
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 12:49:58 -07:00
Lue
a1fe671db8
all: build: fix sdkPath for relative @src.file / fix autocompletion with ZLS / IDEs (#661)
* all: build: fix sdkPath for relative @src.file

Prior to this commit, the build system heavily assumed that the result
`@src.file` would always be absolute, but this is no longer
guaranteed, likely due to there being no such thing as an "absolute
path" in WASI.

It appears that for normal invocations of `zig build`, it is safe to
assume that `@src.file` is absolute. However, when ZLS uses a custom
`build_runner.zig` to collect build configuration, `@src.file` is
actually relative to the current working directory, at least on my
system. For a while, this led to ZLS completions breaking entirely,
but presently it actually causes ZLS to crash!

The solution is not as simple as using relative `sdkPath` results
as-is, because the build system may attempt to resolve these paths
relative to build root, when the paths are actually relative to the
current working directory.

This leads to a sticky situation: the current working directory is a
runtime concept, but `@src.file` is resolved at compile time. However,
it appears that the build runner does not change current working
directory in between compilation and execution, so it is probably safe
to calculate `sdkPath` using runtime current working directory.

Still, this requires major changes with how `sdkPath` works, since
runtime computation and allocations are required. So pretty much
anything that relied on `sdkPath` being comptime-known has been
refactored in this commit.

The most severe result of this is that, for example, `gpu.pkg` can no
longer be a comptime-known constant: it has to be a runtime function
that takes a `*Builder` and returns a `Pkg`.

This commit deals with usages of `*.pkg` and `sdkPath` within Mach
itself, but projects that depend on Mach such as `mach-examples` will
almost certainly require changes as well.

* all: update README to reflect change in pkg usage

For details on updating your code to use this version, see: 88b1106953

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 01:23:46 -07:00
Aaron Winter
f5d9b1ee57
ecs: store column values as independent arrays (#642)
* get column values from separate functions
* split ArchetypeStorage.block into blocks per component type
* ecs: remove allocator field from ArchetypeStorage
* ecs: remove whitespace
* ecs: correct suspicious index operation in setRow
* add back zero-size ColumnType check; bring back reliance on component names
* ecs: validate setRaw length matches
* ecs: fix failing test & move values slice into Column type

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 00:54:10 -07:00
Release automation
3e353f0eaf gpu-dawn: update to latest binary release 2023-01-01 10:22:21 +00:00
Wrench[bot]
d5f37257c5 all: update Zig to version 0.11.0-dev.1023+1c711b0a6
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-01-01 02:40:57 -07:00
Release automation
77184877d4 gpu-dawn: update to latest binary release 2022-12-30 20:35:10 +00:00
Wrench[bot]
a3a0417c21 all: update Zig to version 0.11.0-dev.1000+94780f7cd
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2022-12-30 12:52:31 -07:00