Commit graph

32 commits

Author SHA1 Message Date
Stephen Gutekanst
0645429df9 all: move standalone libraries to libs/ subdirectory
The root dir of our repository has grown quite a lot the past few months.

I'd like to make it more clear where the bulk of the engine lives (`src/`) and
also make it more clear which Mach libraries are consumable as standalone projects.

As for the name of this directory, `libs` was my first choice but there's a bit of
a convention of that being external libraries in Zig projects _today_, while these
are libraries maintained as part of Mach in this repository - not external ones.

We will name this directory `libs`, and if we have a need for external libraries
we will use `external` or `deps` for that directory name. I considered other names
such as `components`, `systems`, `modules` (which are bad as they overlap with
major ECS / engine concepts), and it seems likely the official Zig package manager
will break the convention of using a `libs` dir anyway.

Performed via:

```sh
mkdir libs/
git mv freetype libs/
git mv basisu libs/
git mv gamemode libs/
git mv glfw libs/
git mv gpu libs/
git mv gpu-dawn libs/
git mv sysaudio libs/
git mv sysjs libs/
git mv ecs libs/
```

git-subtree-dir: glfw
git-subtree-mainline: 0d5b853443
git-subtree-split: 572d1144f11b353abdb64fff828b25a4f0fbb7ca

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>

git mv ecs libs/

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 15:12:04 -07:00
Stephen Gutekanst
381f2fe9c5 gpu: fix redeclaration of function parameter errors
This changed in the latest version of Zig to be more strict.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-19 12:34:08 -07:00
Stephen Gutekanst
58600faa0d gpu: make ctx parameters in callbacks always first
This matches the order of context parameters always being first in the Zig stdlib
with e.g. sorting and similar places where a context parameter exists.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
8a0d47b94b gpu: correct context pointer alignments
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
4ed932be0f gpu: simplify callback context types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
29cd383f0e gpu: make Device.setLoggingCallback friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
2b4ba59cc8 gpu: make Buffer.bufferMapAsync friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
13058274b0 gpu: make Adapter.requestDevice friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
185a4231e6 gpu: add adapter.enumerateFeaturesOwned helper
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
a008f96315 gpu: correct Adapter.Properties.backend_type field
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
a468c51ad4 gpu: correct nullability of userdata pointers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
0a69ef98fa gpu: internalize Device types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
e6f3d3c2f0 gpu: move callbacks to separate file
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
1ce40e1b46 gpu: fix tests
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
862a555697 gpu: convert *opaque -> opaque for Device
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
44377e2e27 gpu: internalize Adapter types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
eb646e6f43 gpu: convert *opaque -> opaque for Adapter
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
41fe42e366 gpu: make all next_in_chain fields optional, default to null
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
7fe253d11f gpu: update defaults/optionality for RequestDeviceCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
39ed9b5822 gpu: correct implementation invocations
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
8453b0d2a6 gpu: add Adapter.release
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
6a3e011809 gpu: add Adapter.reference
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
6d954555fb gpu: add Adapter.requestDevice
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
c9914d6d94 gpu: add Adapter.hasFeature
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
cd4021fa56 gpu: add RequestDeviceCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
6ea76e770f gpu: add Adapter.getProperties
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
2b7241be0a gpu: add Adapter.getLimits
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
60496259b2 gpu: add Adapter.enumerateFeatures
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
5b0ae990e3 gpu: add Adapter.createDevice and comptime interface strategy
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
f7df77e2d2 gpu: convert Adapter from enum(usize) to *opaque
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
c3cc9d5ae2 gpu: add TODOs regarding nullability
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
f343326184 gpu: make Adapter an enum with methods
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00