Commit graph

40 commits

Author SHA1 Message Date
Chad Brokaw 6f9e53459a Address review feedback
* Change pgpu-render header file generator to add a comment noting that the file is auto-generated
* Remove bin target and associated dependencies from piet-scene crate
* Remove FP constructors from the Color type
* Better codegen and rounding in Color::to_premul_u32()
* Add kurbo attribution for piet_scene::geometry module
2022-05-10 20:07:41 -04:00
Chad Brokaw 532b6ee808 Add C api for glyph rendering
First cut at a public C api that supports glyph rendering on Metal targets.
2022-05-10 03:56:06 -04:00
Chad Brokaw c749addf6c rebase on timer query patch 2022-05-09 22:39:59 -04:00
Chad Brokaw ba7f85731c add glyph provider API
This exposes a new uniform API for generating scene fragments for glyph outlines.
2022-05-02 04:15:48 -04:00
Chad Brokaw d243d38b04 render using the new scene API
This commit implements actual rendering for the new piet-scene crate.

In particular, it adds a new EncodedSceneRef type in piet_gpu::encoder to store references to the raw stream data. This is used as a proxy for both PietGpuRenderContext and piet_scene::scene::Scene to feed data into the renderer.

Much of this is still hacky for expedience and because the intention is to be a transitional state that maintains both interfaces until we can move to the new scene API and add a wrapper for the traditional piet API.

The general structure and relationships between these crates need further discussion.
2022-04-18 03:48:10 -04:00
Chad Brokaw 753b97c342 Rebase on radial branch 2022-04-11 05:30:08 -04:00
Raph Levien 47f8812e2f Start work on new element pipeline
There's a bit of reorganizing as well. Shader stages are made available
from piet-gpu to the test rig, config is now a proper structure
(marshaled with bytemuck).

This commit just has the transform stage, which is a simple monoid scan
of affine transforms.

Progress toward #119
2021-11-24 08:01:43 -08:00
Raph Levien 2ebdd942cf Use bytemuck
Get rid of `PlainData` trait and use `Pod` from bytemuck instead.
2021-11-23 08:24:16 -08:00
Raph Levien 94949a6906 Mac port of bind layout rework
This gets it working on mac. Also delete old implementation.

There's also an update to winit 0.25 in here, because it was easier to
roll forward than fix inconsistent Cargo.lock. At some point, we should
systematically update all deps.
2021-11-10 13:40:16 -08:00
Raph Levien 19fedf36db
Merge pull request #123 from linebender/tests
Start testing framework, with prefix sum
2021-11-10 11:10:45 -08:00
Raph Levien 33d7b25a92 Start testing framework
This adds a prefix sum test. This patch is also trying to get a little
more serious about structuring both the test runner (toward the goal of
collecting proper statistics) and pipeline stages for the tests.

Still WIP but giving good results.
2021-11-06 11:24:34 -07:00
Raph Levien d04ae44618 Upgrade to Ash 0.33
This was motivated by experiments with the Vulkan memory model. To use
that, we actually need to explicitly enable the relevant feature on
device creation time. That's a lot easier to do now that push_next works
on the structs in that chain. This PR doesn't do that though, it only
upgrades the dependency and cleans up deprecations.
2021-11-05 14:01:50 -07:00
Raph Levien 9cab8b8131 Switch to swash
Use swash instead of ttf-parser.

We can definitely do higher-level use of the swash crate, but this
leaves the integration pretty much as-is.
2021-08-18 12:11:06 -07:00
Raph Levien 379fb1caaa
Merge pull request #89 from linebender/text
Start text rendering
2021-06-23 07:56:24 -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 0d5ff515ec Merge branch 'dx12' into metal 2021-05-26 18:16:45 -07:00
Raph Levien f04da3af9d Add multiplexer abstraction
Adds a new "mux" module which can have multiple backends. As of this
commit, it's not wired up at all, but the functionality should be
reasonably complete.

Minor tweaks to the backend trait to accommodate this, mostly changing
Fence and Semaphore to references so they don't need to be Copy.

Part of the work toward #95
2021-05-25 15:12:37 -07:00
Raph Levien 3dfae7aed6 Merge branch 'usage' into dx12_work 2021-05-21 22:00:49 -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 cd5e799d1a Beginning of Metal back-end
Work in progress, some types in place but mostly a skeleton.
2021-05-21 17:44:49 -07:00
Raph Levien 619fc8d4eb Merge branch 'master' into dx12 2021-05-16 10:19:06 -07:00
Raph Levien 951f3aa508 Start text rendering
This commit puts in basic integration with ttf-parser and starts
populating the various piet text objects. The font is currently
hard-coded.
2021-05-04 08:21:22 -07:00
Raph Levien e6b2cc7b2b Android test application
Adds an example binary that can be run with `cargo apk`.

One thing that will still need manual tuning (for now) is the size of
the canvas. A good followup is to sense that from the window size.
2021-04-05 16:23:11 -07:00
Raph Levien d1b9821fa8 Query extensions at runtime
Don't run extensions unless they're available. This includes querying
for descriptor indexing, and running one of two versions of kernel4
depending on whether it's enabled.

Part of the support needed for #78
2021-04-02 19:58:48 -07:00
Raph Levien d63583083c Start DX12 backend
Very early so far, but cool to have a branch for it.
2020-11-24 10:32:49 -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
Raph Levien b23113461b Minor cleanups
Get rid of warnings. Do cargo update to bump deps.
2020-06-10 14:10:28 -07:00
Raph Levien f3cb904f86 Add command line args for loading svg 2020-05-31 09:57:25 -07:00
Raph Levien 8d01aba237 Update to piet 0.13
Get rid of kurbo patch, as we now use kurbo through piet. Also clean up
some warnings.
2020-05-12 08:26:48 -07:00
msiglreith e2ed54361d Fix rebase issues and split into library and cli/winit binaries 2020-05-04 17:05:54 +02:00
Raph Levien aa83d782ed Fills
Adds fills, and has more or less working tiger render (with artifacts).
2020-05-01 19:42:20 -07: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 e1c0e448ef Encode stroke in scene
This just adds the first step of polyline stroking, which is adding it
to the scene. Also just a bit of cleaning up of dimensions into one
header file.
2020-04-25 08:24:46 -07:00
Raph Levien 7528eaff22 Add piet trait
Use piet render context to encode into scene buffer.

This is adapted from piet-dx12.
2020-04-22 12:07:56 -07:00
Brian Merchant 3270ee64c2 Add f16 support.
Handling f16 requires special work, compared to other scalars, as the minimum conversion operation for u32->f16 in GLSL (unpackHalf2x16) loads two f16s from one u32. This means that in order to minimize unnecessary calls to unpackHalf2x16, we should look-ahead to see if the current f16 has already been extracted in the process of dealing with the last f16. Similar considerations exist for write operations, where we want to pack, when possible, two f16s in one go (using packHalf2x16).
2020-04-21 15:03:06 -07:00
Raph Levien 957f710b91 Render random circles
Poor performance but it renders something.
2020-04-17 21:18:39 -07:00
Raph Levien 228bfc88cd Add scene types
This patch adds a module that contains both scene and ptcl types (very
lightly adapted from piet-metal), as well as infrastructure for encoding
Rust-side.

WIP, it's not wired up in either the shader or on the Rust side.
2020-04-16 18:19:58 -07:00
Raph Levien 86e52a3f47 Start image rendering
Populates the piet-gpu subdir, with an extremely simple renderer. The
main program saves the image to a PNG.

Contains a few fixes (I was confused about the need for multiple
bindings, as opposed to multiple descriptors within a binding).
2020-04-16 14:04:40 -07:00
Raph Levien afd47a7edd Start piet-gpu-derive
This version will be similar but somewhat different to what's in
piet-metal now. Hopefully a little simpler to use (no distinction
between packed and unpacked structs) and better structured.
2020-04-07 21:44:48 -07:00
Raph Levien 1b0248fbbf Starting piet-gpu repo
This brings in a bunch of code from vk-toy but doesn't yet do anything.
2020-04-05 15:17:26 -07:00