Commit graph

14 commits

Author SHA1 Message Date
Raph Levien bae185efbd API reorg
Move types into the toplevel and hide implementation details. Remove
deref of hub CmdBuf to mux. Restrict public visibility of internals.

Most items have some docs, though improvements are still possible. In
particular, there should be detailed safety info.
2021-05-29 21:11:02 -07:00
Raph Levien 7d7c86c44b API changes and cleanup
Add workgroup size to dispatch call (needed by metal). Change all fence
references to mutable for consistency.

Move backend traits to a separate file (move them out of the toplevel
namespace in preparation for the hub types going there, to make the
public API nicer).

Add a method and macro for automatically choosing shader code, and
change collatz example to generate all 3 kinds on build.
2021-05-28 16:14:39 -07:00
Raph Levien 3067733310 Implement more of the API
WIP. Goal is to get collatz running.
2021-05-27 14:55:40 -07:00
Raph Levien 2ecfc7a414 Wire hub to mux
Make the hub abstraction connect to the mux, rather than directly to the
Vulkan back-end.

As of this commit, both command line and winit examples work (on
Vulkan). In theory it should be possible to get them working on Dx12 as
well by translating the shader code, but there's a lot that can go
wrong.

This commit also contains a bunch of changes to mux to make conditional
compilation of match arms work, and new methods to support swapchain.
2021-05-26 09:30:07 -07:00
Raph Levien 47d2e0a756 Add create_buffer_init method
Add a method to create a buffer with initial content, which requires
staging buffers under the hood.

This patch also changes the lower-level (Vulkan) interface to be closer
to the raw Vulkan call.
2021-05-24 13:18:11 -07:00
Raph Levien e9a8b4643b Migrate to BufferUsage
Adopt the BufferUsage concept from WebGPU, and replace MemFlags, which
is inadequate.
2021-05-21 19:43:55 -07:00
Raph Levien 6b06d249ab Builder pattern for pipelines
Use a builder pattern for pipelines and descriptor sets, so we can go
richer without hugely complicating existing code.

WIP
2020-11-24 22:11:38 -08:00
Raph Levien 75c4b62730 Add hub abstraction
The hub does a little better lifetime tracking of resources (so
Rust-side references can be dropped), and in the future will be used for
dynamic selection of backend.

The migration is still a bit half-baked, as there are a bunch of
Vulkan-specific types in the signatures, but it shouldn't be too much
work to sort that out. Perhaps it can wait until there is a second
backend though.

The main motivation for this is to create image objects with lifetime
tracking, one of the things required for #38.
2020-11-18 16:06:08 -08:00
Raph Levien 301abf4db7 Minor cleanups
Mostly cleaning up some comments. Also adds host barrier and a command
to copy a buffer to an image (in preparation for images, see #38).
2020-11-17 14:18:30 -08:00
Raph Levien 8e2f2aeeba Update dependencies
Update to latest versions of all dependencies. Among other things, this
gets us on piet 0.2, though almost all of the changes were around text,
which is not yet implemented.
2020-11-14 08:25:43 -08:00
msiglreith b38e43f0c2 Initial work for surface support
surface: handle extensions

Implement swapchain creation and blit image to screen
2020-05-04 16:24:42 +02:00
Raph Levien aa8b71e922 Reset query pool before use
Quiets validation errors now that we can see them :)
2020-04-29 18:18:04 -07:00
Raph Levien 487d948217 [hal] Add timer queries
Note: also make dispatch size programmable.
2020-04-12 22:28:27 -07:00
Raph Levien 1e1b9ff319 Get Collatz example working
Rework Collatz example to use new traits.
2020-04-06 12:11:37 -07:00