Commit graph

737 commits

Author SHA1 Message Date
Daniel McNab 5156447346
Make the with_winit example run on android (#273) 2023-03-05 11:33:30 +00:00
Arman Uguray 5d915113e8
Merge pull request #287 from armansito/pr-clear-color
Add a base-color uniform to the (full) fine rasterization stage
2023-03-03 14:37:27 -08:00
Arman Uguray 12d5dcd34f Use clap to parse base-color option; remove unused width/height parameters 2023-03-03 14:28:07 -08:00
Arman Uguray acfd570440 Handle error that can be returned by render_to_texture 2023-03-03 11:32:39 -08:00
Arman Uguray d72ad14059 Add a test scene that animates the base color
The test scenes can now supply their own optional base (background)
color. In the with_winit example, we also allow the user to provide a
base color as a CLI option. The precedence is as follows:

   1. Use the color from the CLI options, if any.
   2. Otherwise use the scene provided base color, if any.
   3. Otherwise default to black.
2023-03-03 11:30:12 -08:00
Arman Uguray 3bbf108df5 Renamed clear_color to base_color; addressed review comments 2023-03-02 14:29:44 -08:00
Arman Uguray 05fa8c7c39 RenderParams struct for render-time options
The texture and surface render API now takes render-time parameters
(such as clear color, target width/height) as a RenderParams struct.

The examples have been updated to demonstrate this. The with_winit
example now accepts a clear color as a command line option.
2023-03-02 11:25:19 -08:00
Arman Uguray 8eabc12a72 Add a clear_color uniform
Introduced an RGBA8 config parameter to apply as a base blend color in
the fine stage of the full pipeline.
2023-03-02 09:26:31 -08:00
Arman Uguray 61ae3cde03
Merge pull request #283 from linebender/brush-fix
Fix brush transforms
2023-02-22 22:28:00 -08:00
Chad Brokaw f657b88018 use matrix math! 2023-02-23 01:19:04 -05:00
Chad Brokaw 659ab2ff7e simplify 2023-02-22 23:25:45 -05:00
Chad Brokaw 1f938e5f49 linear algebra refresher 2023-02-22 23:18:51 -05:00
Chad Brokaw 3c15bff867 Proper inverse of translation components 2023-02-22 23:08:38 -05:00
Chad Brokaw c65c19dc4f add additional test scene 2023-02-22 22:32:04 -05:00
Chad Brokaw 6612b7a8ef
From typo in comment 2023-02-22 21:47:35 -05:00
Chad Brokaw 033870d91e Fix brush transforms
This fixes an incorrect application of the inverse transform for radial gradients in fine.

Also fixes an edge case in `SceneBuilder` where a brush transform is identical to the path transform leading to a corrupt encoding.
2023-02-22 20:10:00 -05:00
Arman Uguray 0bb519c1ba
Merge pull request #282 from DJMcNab/rotate_key
Add a keyboard key to rotate the scene
2023-02-22 15:40:52 -08:00
Daniel McNab db243aed4e Add a keyboard key to rotate the scene 2023-02-22 12:35:28 +00:00
Jason Davies 5f59a2e818
Fix include_str! compile error in examples/scenes. (#279)
I don't think CARGO_MANIFEST_DIR should ever end in "/", though I've
only checked on Linux and macOS.
2023-02-11 09:44:18 +00:00
Arman Uguray 68022d2f4f
Merge pull request #277 from DJMcNab/headless
Create a headless example
2023-02-09 08:05:26 -08:00
Daniel McNab 56939df615 Re-use render context in headless 2023-02-09 09:34:53 +00:00
Daniel McNab 19552ad819 Update to better match other examples 2023-02-08 22:48:34 +00:00
Daniel McNab 3a63f00e7e Fix handling of wgpu to hopefully be valid 2023-02-08 21:43:24 +00:00
Arman Uguray fb4cfcdc9e
Merge pull request #275 from DJMcNab/bevy_stageless
Migrate the bevy example to stageless
2023-02-07 13:35:03 -08:00
Daniel McNab d366151970 Support changing the output directory 2023-02-07 16:37:29 +00:00
Daniel McNab 6e1481db40 Finish the headless example 2023-02-07 16:26:56 +00:00
Daniel McNab 65a7970382 Setup infra for headless examples 2023-02-07 12:52:22 +00:00
Arman Uguray 2690c3602d
Merge pull request #271 from armansito/pr-conflation-examples
Introduce test scenes that demonstrate conflation artifacts
2023-02-06 15:24:38 -08:00
Daniel McNab ef44c17f92
Update dependencies, and add more metadata (#272) 2023-02-06 20:12:46 +00:00
Daniel McNab 7abbf2ece2 Migrate the bevy example to stageless 2023-02-06 15:45:36 +00:00
Arman Uguray 97e6e12799 Use accessible colors that maintain contrast in the conflation scene 2023-02-03 12:27:42 -08:00
Arman Uguray fff43bba0d ran cargo fmt; fixed spelling in comment 2023-02-03 09:34:12 -08:00
Arman Uguray dc2e6690c4 Introduce test scenes that demonstrates conflation artifacts
Added two scenes that demonstrate conflation artifacts as described in
https://github.com/linebender/vello/issues/49. The first scene
demonstrates adjacent triangles and rects that belong to the same path
and use opposite winding.

The second scene demonstrates strokes with overlapping square caps
(these strokes are currently expressed as rects painted with the NonZero
fill rule).
2023-02-03 09:32:41 -08:00
Daniel McNab 020a7f5c01
Split the examples into frontends with a shared scene repository (#262) 2023-02-03 10:22:39 +00:00
Daniel McNab 9721d4a6ac
Some WASM changes - including a run_wasm alias (#251) 2023-01-31 16:12:46 +00:00
Daniel McNab f84e244fd7
Update to wgpu 0.15 (#263) 2023-01-31 16:07:03 +00:00
Raph Levien 872fc5c6de
Merge pull request #269 from linebender/fix_fail
Partially revert uniform load of bump.failed
2023-01-30 16:21:35 -08:00
Raph Levien 27e6fdd267 Partially revert uniform load of bump.failed
Just load the atomic bump counter directly instead of piping it through a shared variable, when workgroupUniformLoad is not available. The value is in fact dynamically uniform, but that depends on the stage not setting its own failure flag, a fairly subtle invariant.

I think there was a write-after-read hazard for the reuse of sh_part_count[0]. However, doing the experiment of just changing that doesn't fix the problem on mac. It's possible there's a shader compilation problem (possibly the same one as provoking the storageBarrier workaround in tile_alloc), or also possibly a logic error I'm not understanding.

In any case, this change does appear to fix the hangs on mac.

Fixes #267
2023-01-29 09:01:13 -08:00
Raph Levien 6a184244e6
Merge pull request #264 from linebender/async
Experimental async wiring
2023-01-27 12:43:48 -08:00
Raph Levien db018da537 Make wasm port work again
This cheats somewhat, using the non-robust version of the pipeline for
wasm, and blocking on native.
2023-01-26 17:41:30 -08:00
Raph Levien 264fd3ec12 Merge branch 'main' into async 2023-01-26 17:27:53 -08:00
Raph Levien ca79d5c8d0
Merge pull request #267 from linebender/wasm_fix
Fixes to get example running in wasm
2023-01-26 14:17:56 -08:00
Raph Levien d6cbae2a3f Fixes to get example running in wasm
A number of things were wrong:

* The args were missing to `run`
* The robust memory changes introduced uniformity errors
* `clear_buffer` is a todo for wgpu on wasm
* Some more time calls crept in
* Initializing both env_logger and console_logger fails

In addition, we conditionally opt the shaders into
`workgroupUniformLoad`, as that's available on wasm but not yet native.

Some of the things (args, uniformity errors) are important fixes. Other
things (clear_buffer, wUL being optional) are workarounds for wgpu
limitations and have TODO items to be removed when wgpu catches up.
2023-01-26 12:19:12 -08:00
Raph Levien 3b766d9969 Fix broken non-buffer_labels build 2023-01-25 06:33:38 -08:00
Raph Levien 418256ffd1 Start async wiring
Make async versions of the main library entry points, and invoke those from the with_winit example.

Right now this just prints the contents of the bump buffer before just running the fine dispatch, but it could apply conditional logic.
2023-01-24 21:09:00 -08:00
Raph Levien 17907893af Create Render struct
Separate coarse and fine stages as separate methods of Render struct.
2023-01-24 17:42:53 -08:00
Raph Levien e47c5777cc Make bind_map persistent
We'll be persisting some buffers across recordings, so make the mapping from id to actual resource scoped to the engine rather than a single `run_recording` call.

Part of the change is being explicit about which buffers to free and when. That will enable more fine-grained reuse of buffers, including within a recording.
2023-01-24 17:42:29 -08:00
Daniel McNab bf523e8845
Do another pass on the README (#258) 2023-01-23 16:27:42 +00:00
jneem 942da778a3
Merge pull request #261 from jneem/main
Allow selecting GPU from env
2023-01-21 15:33:42 -06:00
Joe Neeman 338bd30870 Allow selecting GPU from env 2023-01-21 14:30:40 -06:00