Commit graph

912 commits

Author SHA1 Message Date
Raph Levien
c3d81e0985 Mostly working path rendering
It draws multiple paths and applies affine transformations.

One problem: RGBA writing is byte-reversed and premultiplied.
2022-11-04 08:59:23 -07:00
Raph Levien
06fa3cb9ab Checkpoint
Felt like checkpointing what I have before trying to run the pipeline. Theoretically everything should work.
2022-11-03 19:37:38 -07:00
Raph Levien
5851ef1417 Shaders loaded
This checkpoint loads the shaders for full rendering, but there's a bunch of stuff still needing to be done.
2022-11-03 16:53:34 -07:00
Raph Levien
7ac327c684 Unify scene buffer
All streams of the scene are combined into a single buffer. This is very much like existing piet-gpu, however the various outputs from the compute stages (whether computed on CPU or GPU) will retain their separate bindings, which is more native to WGSL.

There's a touch of ergonomics loss, in particular when we do transforms we'll need to unmarshal them by hand, but I think overall not too bad.
2022-11-02 18:07:32 -07:00
Raph Levien
5c6ec1efa3 Checkpoint
Many shader stages written.
2022-11-01 16:20:15 -07:00
Raph Levien
40416fd2ea Another checkpoint 2022-11-01 13:55:58 -07:00
Raph Levien
06ec395b68 Checkpoint coarse rasterization
The bones of coarse rasterization are in place (so far, fills only). Still not suitable for end-to-end (need to generate bounding boxes, among other things), but getting closer.
2022-11-01 13:55:58 -07:00
Raph Levien
b6da6d958b Write more shaders
This is super WIP, but represents partially written shaders for more of
the piet-gpu pipeline. Checkpointing as other work is incoming.
2022-11-01 13:55:58 -07:00
Daniel McNab
1b84071d33
WGSL: Allow imports anywhere (#196)
This means we support imports not at the start of a line.
2022-11-01 20:41:47 +00:00
Daniel McNab
3831b58dea Prepare for wgsl-analyzer upgrades (#195)
* Prepare for wgsl-analyzer upgrades

* Fix the exponentials
2022-10-27 10:48:34 -07:00
Daniel McNab
afa706bd7e
Use 'C style' preprocessing in piet-wgsl (#194)
This lets us use https://github.com/wgsl-analyzer/wgsl-analyzer for writing the wgsl files.
The imports (for wgsl-analyzer) have to be machine specific at the moment - to use this you need to configure .vscode/settings.json yourself. The alternative is to point them at static files on GitHub, which is tempting to make things easier, but would potentially go out of sync with what is actually used.
2022-10-27 15:27:46 +01:00
Raph Levien
b42679c675
Merge pull request #193 from linebender/wgsl
Initial commit of piet-wgsl
2022-10-26 13:29:31 -07:00
Raph Levien
911dee23cd Address review feedback
Cleans up some of the immediate issue, but still hacky and has a bunch
of stuff hard-coded.
2022-10-25 09:03:13 -07:00
Raph Levien
a50d76cb1c rustfmt 2022-10-24 15:17:51 -07:00
Raph Levien
b6c4963d4c Initial commit of piet-wgsl
Starting an experimental port to WGSL shader language, using wgpu to run the examples. As of this commit, it's quite hacky and takes some shortcuts, but does render paths to a grayscale texture.
2022-10-24 15:08:14 -07:00
Chad Brokaw
4edea5fbc9
Merge pull request #190 from dfrg/api2
Remove piet API and replace with scene fragments
2022-10-19 16:02:21 -04:00
Chad Brokaw
6b1c315163 update c-api deps 2022-10-19 15:54:43 -04:00
Chad Brokaw
fe6ed00447 merging Cargo.lock is fun 2022-10-19 15:44:30 -04:00
Chad Brokaw
fd14495db6 Merge branch 'api2' of https://github.com/dfrg/piet-gpu into api2 2022-10-19 15:36:44 -04:00
Chad Brokaw
91a6d59cdc Update Cargo.lock 2022-10-19 15:23:18 -04:00
Chad Brokaw
c616c69dd8 update tests 2022-10-19 15:21:57 -04:00
Chad Brokaw
ca6c43adab update dependencies 2022-10-19 15:21:29 -04:00
Chad Brokaw
09773f89a3 fix gradient ramp color packing 2022-10-19 15:20:04 -04:00
Chad Brokaw
6c5a2cb4f4 macOS fixes
* Fix call to removed encoded_scene method in pgpu-render
* Add new ImageFormat::Surface variant to select a pixel format that matches the platform specific surface format. This makes gradients consistent across platforms.
2022-10-19 15:20:04 -04:00
Chad Brokaw
c84d1f6df5 format :( 2022-10-19 15:20:04 -04:00
Chad Brokaw
d07fda8ef8 Make transforms stateless
Removes the transform state mutator from SceneBuilder and adds transform parameters to push_layer, fill and stroke methods.
2022-10-19 15:20:04 -04:00
Chad Brokaw
c0fcdbad58 make gradient ramps late bound
Removes ResourceContext type. This makes scenes and fragments nearly identical. Should they be merged?
2022-10-19 15:20:04 -04:00
Chad Brokaw
782e7d51d2 Remove piet API & replace w/ fragments
Removes the dependency on the piet crate and replaces all uses with the scene crate.  Also does some cleanup of the scene API, renaming some types and moving them all to the crate root for better ergonomics.
2022-10-19 15:19:20 -04:00
Chad Brokaw
73833eb7c3 update tests 2022-10-19 15:05:23 -04:00
Chad Brokaw
14247770aa update dependencies 2022-10-19 14:58:54 -04:00
Chad Brokaw
f7b1bca18b fix gradient ramp color packing 2022-10-19 14:29:40 -04:00
Raph Levien
12fe2c10bc
Merge pull request #191 from linebender/version_bump
Update dependencies
2022-10-18 07:30:59 -07:00
Raph Levien
c5d71b4349
Pare down winit features to reduce bloat
Co-authored-by: m-hugo <56653363+m-hugo@users.noreply.github.com>
2022-10-18 07:18:45 -07:00
Raph Levien
b63df8e9b8 Fix android example
Updates the android example to use latest ash plumbing.
2022-10-17 20:30:57 -07:00
Raph Levien
69d16ac209 Fix ash and raw_window_handle breakage
Follow API changes introduced by ash, ash_window, and raw_window_handle.
Also updates ash_window to 0.12.

Note: this doesn't fix the android client.
2022-10-17 18:12:41 -07:00
Raph Levien
8e3df2573c Update dependencies
Update various dependencies to latest.
2022-09-21 17:26:02 -07:00
Chad Brokaw
a6597af52a macOS fixes
* Fix call to removed encoded_scene method in pgpu-render
* Add new ImageFormat::Surface variant to select a pixel format that matches the platform specific surface format. This makes gradients consistent across platforms.
2022-08-17 16:06:48 -04:00
Chad Brokaw
8ee317a922 format :( 2022-08-16 14:55:59 -04:00
Chad Brokaw
7fe022228a Make transforms stateless
Removes the transform state mutator from SceneBuilder and adds transform parameters to push_layer, fill and stroke methods.
2022-08-16 14:52:04 -04:00
Chad Brokaw
cd25528abd make gradient ramps late bound
Removes ResourceContext type. This makes scenes and fragments nearly identical. Should they be merged?
2022-08-11 18:00:53 -04:00
Chad Brokaw
2e8781fbb6 Remove piet API & replace w/ fragments
Removes the dependency on the piet crate and replaces all uses with the scene crate.  Also does some cleanup of the scene API, renaming some types and moving them all to the crate root for better ergonomics.
2022-08-11 15:29:15 -04:00
Chad Brokaw
9dd4559b00
Merge pull request #188 from dfrg/cpath
Expose path rendering in C API
2022-08-09 11:42:40 -04:00
Chad Brokaw
6b7f991da5
Merge pull request #185 from dfrg/xform2
Encode absolute transforms
2022-08-08 12:14:06 -04:00
Chad Brokaw
5a127e09a5 Expose path rendering in C API
* capi: Add PathIter type and support for encoding fills
* capi: Minimal support for brushes (solid color only)
* Add flush method to command buffers
* Better initial heuristic for memory buffer size based on target dimensions
2022-08-08 01:03:27 -04:00
Chad Brokaw
2e8be24fc9 fix fragment transform logic 2022-08-05 14:00:30 -04:00
Chad Brokaw
d7773bf877 formatting 2022-07-16 16:49:18 -04:00
Chad Brokaw
2c258363ad restore tile.h to maintain sync with tile.rs 2022-07-16 16:48:04 -04:00
Chad Brokaw
8943fa7ea6 encode absolute transforms
This removes the GPU transform stage, changes shaders to reference transforms directly from the scene, and modifies the render context to maintain a transform stack.
2022-07-15 14:36:20 -04:00
Chad Brokaw
e328bea0b8
Merge pull request #184 from dfrg/multi-surface
Separate Instance and Surface creation in HAL
2022-07-15 13:16:47 -04:00
Chad Brokaw
d6ffe970f9 Make graphics support non-optional for Vulkan
This also removes the new present flag, deletes some commented code and explains the lack of surface validation in device selection.
2022-07-15 13:14:12 -04:00