Commit graph

425 commits

Author SHA1 Message Date
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
Stephen Gutekanst
3c5be625af webgpu: build abseil-cpp into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
9387981c22 webgpu: build Mach dawn-native C shims into a library
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
418d72a766 webgpu: cleanup dawn linkage
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
00095ded60 webgpu: cleanup dawn example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
ea197f9dca webgpu: update dawn example to use latest mach-glfw API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
8a4cbc0e5d webgpu: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
e9bad16cda webgpu: update dawn to fix inclusion of vulkan-deps
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
26ee017b2e webgpu: update dawn to not use any submodules itself (commit all dependencies)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
71e47ae228 webgpu: update dawn (undo abseil-cpp upgrade)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
fe328e2309 webgpu: update dawn to correct vulkan-deps submodules
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
f785bff7f4 webgpu: update dawn to remove vulkan-deps shell repository
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
88b5e5bc70 webgpu: update dawn to fix vulkan-deps submodules
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
3bac31976f webgpu: update dawn to fix abseil-cpp missing revision
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
6492d29986 webgpu: update dawn to include more submodule dependencies
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
cff0977a42 webgpu: update dawn to fix abseil-cpp module location
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
4c34dc4ca2 webgpu: update dawn to include abseil-cpp submodule
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
d7be41e35f webgpu: add libs/mach-glfw
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
b2aca7fdde webgpu: begin building Dawn with Zig
* MacOS support functional
* C shims for dawn_native functionality, e.g. required utilities for binding to a GLFW window.
* Fully building with Zig, but depends on ziglang/zig#10096 for Obj-C++ support.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
Stephen Gutekanst
564248c09b webgpu: add libs/dawn submodule
This is a fork of Dawn which has generated sources comitted to the repo so that depot_tools,
ninja, gn, etc. are not needed.

It also enables us to track a specific version of Dawn and ensure it's compatible with our
bindings, etc.

https://github.com/hexops/dawn

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-21 08:32:03 -07:00
InKryption
3e0bf00015
glfw: window hint default values parity test with attributes (#81)
* glfw: window hint default values parity test with attributes
* glfw: add test-mode-only variable that controls whether to set or ignore the `Window.Hints` struct passed to `Window.create`, and inline `failedToCreateWindow`
* glfw: include `context_no_error` hint/attribute in test with comment, fix oversight in `create` concerning the `defer defaultHints()` statement

Co-authored-by: Stephen Gutekanst <stephen.gutekanst@gmail.com>
2021-11-20 12:42:52 -07:00
InKryption
e024ced541 glfw: further reorganize Window.Attrib to match with Window.Hint. 2021-11-17 09:33:53 -07:00
InKryption
9e757e6433 glfw: reorganize Window.Attrib to be in the same style as Window.Hint 2021-11-17 09:33:53 -07:00
InKryption
70c7da4ea5 glfw: make glfw.Cursor.Shape public
Following a similar change made to types in 'Window.zig'
2021-11-16 19:33:24 -07:00
Silver
673ce14acf glfw: remove [*c] pointers from api and return lengthed strings when possible 2021-11-16 07:12:02 -07:00
InKryption
28a0aebd95
glfw: window hints rework (#71)
* glfw: make comments into doc comments
* glfw: Publicize Window.CursorPos, Window.Size, Window.Pos, and Window.FrameSize
* glfw: Make enum value name the same format as other enum value names
* glfw: Window hints rework patch
* glfw: Relegate `Window.hint` to testing; move it down to just above the tests to reflect this, add doc comment line
* glfw: handle error `Error.InvalidEnum` explicitly, for clear error message in this unlikely edge case
* glfw: instate `Hint.context_no_error` as a hint, as it actually is specified to be a Window creation hint by the docs, and affirm removal of `Hint.context_revision`, which isn't.
The docs don't seem to specify a default value for `Hints.context_no_error` to take on, so we could set it based on `std.debug.runtime_safety` like this.
* glfw: default `context_no_error` to `false`, and added a note of caution about its usage as suggested.
* glfw: Inline enum values of `ClientApi`, `ContextCreationApi`, `ContextRobustness`, `ContextReleaseBehavior`, and `OpenGlProfile` from consts.zig, and remove the now unused constants (replaced by aformentioned enum values).
* glfw: Reference `Window.Hint` enum instead of `Window.Hints` struct to ensure fields are the same
* glfw: add comment explaining default values of `Window.Hints`
* glfw: change `OpenGlProfile` to `OpenGLProfile` based on established naming convention
* glfw: Update actual declaration of `OpenGLProfile`
* glfw: call `Window.defaultHints` after window creation, not before
* glfw: remove 'consts.zig', and move `dont_care` directly into 'main.zig'; fix anything referencing it.
* glfw: put `Window.defaultHints` into defer statement to handle cleanup in all paths
* glfw: move `Hint.focused` to match position of `Hints.focused`
* glfw: do 'zig fmt glfw/src'
* glfw: Cull `Window.Hint` comments, polish remaining; match order entirely according to current GLFW docs
* glfw: Change `Window.Hints.*Api` to `Window.Hints.*API`

Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-15 18:41:16 -07:00
Ali Chraghi
50719f5347 glfw: fix typo prevents building for Wayland 2021-11-15 17:49:13 -07:00
Stephen Gutekanst
fd703e98e4 glfw: update setIcon hotfix for undefined behavior
See https://github.com/GLFW/glfw/pull/1986

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-16 00:22:45 +00:00
Silver
82a9cf616d glfw: patch more undefined behaviour
See glfw/glfw#1989
2021-11-15 16:22:39 -07:00
Ali Chraghi
83854e27a6 Update README.md 2021-11-15 16:14:38 -07:00
slimsag
68da50085f README: regenerate sponsors section 2021-11-15 22:37:30 +00:00
InKryption
e486794be3 glfw: Make enum value name the same format as other enum value names 2021-11-15 15:37:07 -07:00
InKryption
eef166e90b glfw: Publicize Window.CursorPos, Window.Size, Window.Pos, and Window.FrameSize 2021-11-15 15:37:07 -07:00
InKryption
2214e91ad5 glfw: make comments into doc comments 2021-11-15 15:37:07 -07:00
slimsag
ac4eb8216c README: regenerate sponsors section 2021-11-10 18:42:48 +00:00
InKryption
220c285798 glfw: Update readme to reflect changes made to glfw.init 2021-11-10 11:42:24 -07:00
InKryption
f00367e696 glfw: Update tests in all other files to reflect changes made to glfw.init 2021-11-10 11:42:24 -07:00
InKryption
e9175fb9f1 glfw: change init function to accept hints as paramaters via new InitHints struct which has default field values reflecting the default values specified by GLFW current documentation, privatize hint-setting wrapper API, and update tests 2021-11-10 11:42:24 -07:00
Stephen Gutekanst
0d12fd5713 add missing glfw subtree metadata
git-subtree-dir: glfw
git-subtree-mainline: 0d84c25938
git-subtree-split: 03fc8bc42417fbc1e770103f4b9c0e6127b05a1b

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-07 21:07:05 -07:00
Stephen Gutekanst
c4ecd49545 glfw: inform in PR template to send all PRs to main repository
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2021-11-07 20:57:31 -07:00