Commit graph

1139 commits

Author SHA1 Message Date
Silver
6ec499cf70 clean up build.zig and add type to pkg def 2022-04-07 18:42:15 -07:00
Stephen Gutekanst
8b2ae06121 CI: temporarily disable macOS 11 test
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
f7cea5f304 CI: use macos-latest runners (macos-12 runners rarely available)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
3bf471ccf9 CI: fix x86_64-windows -> macOS build
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
51b1f36d0a CI: correct build for macOS 12
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
d3d17ec570 CI: build on macos-12 not 11
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
c3f8f9a4d5 correct glfw package dependency
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
d0c55db017 CI: more explicitly denote cross-compilation targets
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
49f80de6ab add higher-level app library
Fixes hexops/mach#190

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
38095942d9 gpu: make Options public
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
451b437322 gpu: add std.build.Pkg definition
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
0161ccef37 glfw: add std.build.Pkg definition
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Stephen Gutekanst
cd88057edd gpu: add gpu.link to make using library elsewhere easier
Helps hexops/mach#189

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-04-05 00:16:51 -07:00
Roman Frołow
73c145819a
README: fix URL to build-an-ecs blog series (#204) 2022-04-04 22:09:39 -07:00
Release automation
3d0be5ad53 gpu-dawn: update to latest binary release 2022-03-31 17:58:16 +00:00
Stephen Gutekanst
f321651c62 gpu-dawn: fix bad merge
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-31 17:18:08 +00:00
Stephen Gutekanst
a361f807a9 gpu-dawn: fix error when curl is unavailable / not installed
Fixes hexops/mach#197

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-31 16:57:40 +00:00
Stephen Gutekanst
fbbb0b0ae0 gpu: use Dawn adapter creation API for now so that GPU_BACKEND selection works
`webgpu.h` does not expose a method of choosing the GPU backend (vulkan, opengl, opengles, etc.)
at present. The only way to achieve this is to use Dawn's C++ API, which we expose as C shims
under the `machDawnNative*` prefix.

For now, we will use the Dawn adapter creation API so that we can choose between Vulkan/OpenGL/OpenGLES
etc via the `GPU_BACKEND` env var.

In the future, I believe we can do something nicer here. For example, perhaps we extend our `requestAdapter`
method (after all, we do not need to strictly match `webgpu.h`) to take such an option and be Dawn-aware so
that it handles this more seamlessly behind the scenes.

Fixes https://github.com/hexops/mach/issues/192#issuecomment-1080895255

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-31 16:57:30 +00:00
Stephen Gutekanst
1f076da7bf gpu: add gpu.NativeInstance.fromWGPUAdapter
For when you have a native adapter and need a wrapped one.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-31 16:51:18 +00:00
Stephen Gutekanst
354df53523 gpu-dawn: expose dawn::native::Adapter->Get as C shim
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-31 16:50:09 +00:00
Stephen Gutekanst
13de9d6a8c gpu: make -Ddawn-from-source=true work in gpu/ example
Previously this was only working in the gpu-dawn/ example.

Fixes hexops/mach#196

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-31 16:45:46 +00:00
Release automation
263b9708fd gpu-dawn: update to latest binary release 2022-03-31 01:35:53 +00:00
Mitchell Hashimoto
88ee3bf668 gpu-dawn: build.zig needs to reference thisDir for C file 2022-03-30 17:34:36 -07:00
Mitchell Hashimoto
d26c76b074 system_sdk for linux-aarch64 2022-03-30 10:05:58 -07:00
Stephen Gutekanst
a2f65d5a23 gpu-dawn: error if curl is not installed, less verbose errors
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>
2022-03-27 12:53:37 -07:00
Stephen Gutekanst
074721ece7
doc: add known issues 2022-03-27 12:03:13 -07:00
Release automation
4d49c673e5 gpu-dawn: update to latest binary release 2022-03-27 06:33:21 +00:00
Stephen Gutekanst
d785e8f2d3 gpu-dawn: make macOS cross compilation errors more helpful
Fixes hexops/mach#187

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 22:44:55 -07:00
Stephen Gutekanst
add120b2a1 gpu-dawn: don't leave binary download cache in bad state if error occurs
Fixes hexops/mach#188

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 22:33:56 -07:00
Release automation
d7230d6b5b gpu-dawn: update to latest binary release 2022-03-26 22:10:27 +00:00
Stephen Gutekanst
a44f91448b gpu-dawn: use versioned python command when bundling releases
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 14:09:17 -07:00
Stephen Gutekanst
128fc0a444 gpu-dawn: update to Zig 0.10.0-dev.1600+af844931b
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:31:34 -07:00
Stephen Gutekanst
0753c5e4c8 glfw: update to Zig 0.10.0-dev.1600+af844931b
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:31:24 -07:00
Stephen Gutekanst
4cde76f5af CI: update to Zig 0.10.0-dev.1600+af844931b
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:31:13 -07:00
Stephen Gutekanst
ed742ec7ca gpu-dawn: CI: use mainline Zig build again for Windows
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:26:26 -07:00
Stephen Gutekanst
2288fa8d78 glfw: CI: windows: disable progress bar for faster downloads
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:25:56 -07:00
Stephen Gutekanst
d2a2ee8022 CI: windows: disable progress bar for faster downloads
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-26 13:25:46 -07:00
Andrew Gutekanst
8072839973 gpu: update GetModuleHandleW usage in examples 2022-03-19 18:01:41 -07:00
Release automation
fc2c0c0ff8 gpu-dawn: update to latest binary release 2022-03-19 21:37:20 +00:00
Stephen Gutekanst
7060343f42 gpu-dawn: mention Dawn license is permissive
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 13:51:50 -07:00
Stephen Gutekanst
0ef13eb1cc ecs: third major redesign/rethink of implementation
In the past:

* hexops/mach#156 was the initial ECS implementation detailed in https://devlog.hexops.com/2022/lets-build-ecs-part-1
* hexops/mach#157 was the second major redesign in which we:
    * Eliminated major limitations (e.g. inability to add/remove components at runtime)
    * Investigated sparse sets
    * Began thinking in terms of databases
    * Enabled runtime introspection

Our second revision of the ECS, however, still had _archetypes_ exposed as a public-facing
user concern. When a new component was added to an entity, say a weapon, the table storing
entities of that archetype changed to effectively have a new column `?Weapon` with a null
value for _all existing entities of that archetype_. We can say that our ECS had archetypes
as a user-facing concern AND this made performance worse: when iterating all entities with
a weapon, we needed to check if the component value was `null` or not because every column
was `?Weapon` instead of a guaranteed non-null value like `Weapon`. This was a key learning
that I got from [discussing ECS tradeoffs with the Bevy team](https://github.com/hexops/mach/pull/157#issuecomment-1022916117).

This third revision of our ECS has some big benefits:

* Entities are now just IDs proper, you can add/remove arbitrary components at runtime.
    * You don't have an "entity which always belongs to one archetype table which changes"
    * Rather, you have an "entity of one archetype" and adding a component means that entity _moves_ from one archetype table to another.
    * Archetypes are now an implementation detail, not something you worry about as a consumer of the API.
* Performance
    * We benefit from the fact that we no longer need check if a component on an entity is `null` or not.
* Introspection
    * Previously iterating the component names/values an entity had was not possible, now it is.
* Querying & multi-threading
    * Very very early stages into this, but we now have a general plan for how querying will work and multi-threading.
    * Effectively, it will look much like interfacing with a database: you have a connection (we call it an adapter)
      and you can ask for information through that. More work to be done here.
* Systems, we now have a (very) basic starting point for how systems will work.

Some examples of how the API looks today:

* 979240135b/ecs/src/main.zig (L49)
* 979240135b/ecs/src/entities.zig (L625-L656)

Much more work to do, I will do a blog post detailing this step-by-step first though.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 10:59:26 -07:00
Release automation
1428569e66 gpu-dawn: update to latest binary release 2022-03-19 15:19:45 +00:00
Release automation
42b1501ca9 gpu-dawn: update to latest binary release 2022-03-19 15:07:26 +00:00
BratishkaErik
1838faf3f9
glfw: add instructions for Gyro in README.md (#184)
* glfw: add instructions for Gyro in README.md
2022-03-19 07:43:23 -07:00
Stephen Gutekanst
141442d5cb gpu-dawn: README: make note of msvc target
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 07:18:35 -07:00
Stephen Gutekanst
bdc556f9d5 gpu: README: correct links to issue tracker / subproject
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 07:05:42 -07:00
Stephen Gutekanst
a521a4707a gpu-dawn: README: various cleanup & polishing
Fixes hexops/mach#178

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 07:05:04 -07:00
Stephen Gutekanst
82f8113dcb gpu: README: further update TODO list
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 00:51:48 -07:00
Stephen Gutekanst
689f2b5122 gpu: example: change window title to "mach/gpu window"
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 00:51:48 -07:00
Stephen Gutekanst
fa9b5f1d5d gpu: example: reenable uncaptured error handling
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 00:51:48 -07:00