Arman Uguray
64020a3f77
[vello_shaders] Fix typo in README
2023-03-29 11:23:06 -07:00
Arman Uguray
d2b41d628b
[vello_shaders] Add a README
2023-03-29 11:20:56 -07:00
Arman Uguray
7a99ae5a9e
[vello_shaders] Add copyright headers
2023-03-29 11:20:38 -07:00
Arman Uguray
eb1d4be36a
[vello_shaders] Pin naga dependency
2023-03-29 11:20:15 -07:00
Arman Uguray
4f445c2e0a
[vello_shaders] Provide workgroup shared memory allocation sizes
...
Naga traslates workgroup variable declarations to threadgroup
address-space entry-point parameters when generating MSL. Metal API
validation requires that the memory sizes for these parameters be set
explicitly by calling setThreadgroupMemoryLength:index on the
MTLComputeCommandEncoder.
The crate now calculates the required memory size for global workgroup
variables that are accessed by the entry point and provides them
alongside the binding list. This is abstracted separately from the
binding list.
While the current usage that we're aware of is limited to Metal, this
information is being provided as part of the generic ComputeShader type
instead of a MSL-specific type, as the information itself is computed
from the parsed WGSL IR and not specific to Metal.
2023-03-29 10:38:10 -07:00
Arman Uguray
b52ef32c90
[vello_shaders] Use thiserror::Error for the library Error type
2023-03-29 10:38:10 -07:00
Arman Uguray
14ab8d90ae
[vello_shaders] Use the per_entry_point_map option for MSL
2023-03-29 10:38:10 -07:00
Chad Brokaw
87803cc8a6
fmt
2023-03-29 10:38:10 -07:00
Chad Brokaw
a532eacf7b
Replace HashMap with sorted Vec so builds are deterministic
2023-03-29 10:38:10 -07:00
Chad Brokaw
a5434569b6
fix build rerun path
2023-03-29 10:38:10 -07:00
Chad Brokaw
0db71153ad
Playing with shader permutations and AOT compilation
2023-03-29 10:38:10 -07:00
Raph Levien
1a6add81b1
Merge pull request #298 from linebender/flower
...
Change image to flower
2023-03-22 18:13:31 -07:00
Raph Levien
8cfe903f7e
Change image to flower
...
Using vector graphics for the image doesn't make a huge amount of sense. The flower photo is by Raph and happily licensed to anyone who wants to use it.
2023-03-22 15:53:44 -07:00
Chad Brokaw
4c5ff6b5bf
Merge pull request #297 from linebender/vello-fello
...
Replace font backend
2023-03-21 22:07:36 -04:00
Chad Brokaw
eb8cc5275f
Replace font backend
...
This replaces the old moscato font backend with one that has proper support for variable fonts.
2023-03-21 19:27:21 -04:00
Arman Uguray
a1f319d090
Merge pull request #288 from armansito/frame-stats
...
Add frame statistics UI to with_winit example
2023-03-21 15:37:43 -07:00
Arman Uguray
703d22f4b7
[frame_stats] Use match statement for color coding graph
2023-03-21 15:29:16 -07:00
Arman Uguray
6f3051837f
[frame_stats] Adapt the graph scale based on the current mean frame time
...
This allows the graph to display at a reasonable scale in the face of
fluctuations and a max recorded sample that is much larger than the
current average.
2023-03-21 15:16:45 -07:00
Arman Uguray
e6f4f6de57
[frame_stats] Draw thresholds for 16.66ms, 33.33ms, and 8.33 timings
...
Also added color coding for the bar graph based on these thresholds.
2023-03-21 11:38:38 -07:00
Arman Uguray
5ba2826460
[frame_stats] Scale the frame time graph linearly
...
The sqrt scale doesn't add much value any more since the max frame time
can be reset with a keypress.
2023-03-21 11:34:33 -07:00
Arman Uguray
8bd1bdfaa8
[frame_stats] Use wgpu::PresentMode::AutoVsync/AutoNoVsync for VSync mode
...
The Auto* modes should have wider compatibility as they implement
fallback behavior based on what the platform supports. This also means
that on web "vsync off" will likely be incorrect.
2023-03-21 11:34:26 -07:00
Arman Uguray
02a222f435
[frame_stats] Reduce stats time delta between elapsed() and next frame start time
...
This does not account for the time spent in processing
`Stats::add_sample` but it should be very close.
2023-03-21 11:34:20 -07:00
Arman Uguray
a1c0df1058
[frame_stats] Track frame time more tightly
...
We now track the frame time from snapshot to snapshot corresponding to
the exact presentation time.
2023-03-21 11:34:14 -07:00
Arman Uguray
1250cdcf86
[frame_stats] Add a VSync toggle key; show the current VSync state in stats UI
2023-03-21 11:34:08 -07:00
Arman Uguray
306aeab6df
[frame_stats] Key binding to clear min/max frame time; address review comments
2023-03-21 11:34:01 -07:00
Arman Uguray
1ac4a4f1a8
[frame_stats] Draw a live plot of frame time samples
...
Also abandoned the FrameScope idea and revised the `Stats::add_sample`
to accept a struct to accept a variety of future measurements.
2023-03-21 11:33:50 -07:00
Arman Uguray
bacaeebcb6
[frame_stats] Show viewport resolution on the stats layer
...
Also set the stats layer toggle to be on by default until we add some UI
to toggle it on mobile.
2023-03-21 11:33:43 -07:00
Arman Uguray
d7bacbcc3f
[frame_stats] Build stats layer layout based on viewport dimensions
2023-03-21 11:33:35 -07:00
Arman Uguray
89fb1b89da
[frame_stats] Add frame statistics UI to with_winit example
...
Added a module for frame time statistics and UI layer that displays
the average, minimum, and maximum frame time alongside FPS. The UI
can be toggled by pressing the `S` key.
2023-03-21 11:33:22 -07:00
Daniel McNab
17096ad878
Update for Bevy 0.10 and other dependencies ( #290 )
2023-03-16 15:44:10 +00:00
Daniel McNab
fd6bfe91d6
Fix handling of interactivity ( #295 )
...
* Fix handling of interactivity
* Sort out silly mixup
2023-03-16 13:38:43 +00:00
Florian Köhler
c503973739
Add space key for transform reset ( #294 )
...
Co-authored-by: Florian Köhler <power-unsealed>
2023-03-15 15:18:16 +00:00
Chad Brokaw
f3d45fc01d
Merge pull request #293 from linebender/images
...
Let's add images
2023-03-15 08:37:36 -04:00
Chad Brokaw
a6307a2520
predicate image loads on non-zero mask
2023-03-15 08:37:00 -04:00
Chad Brokaw
923c949e95
Remove some unused imports
2023-03-10 21:00:42 -05:00
Chad Brokaw
37f05b853c
Address initial review feedback
...
* Add comment about naughty ptr2int cast
* Change Option to anyhow::Result in test scene ImageCache
* Replace magic constant with pixel stride from selected format
2023-03-10 15:14:34 -05:00
Markus Siglreithmaier
dccd59a217
Merge pull request #292 from msiglreith/svg-transform
...
vello_svg: Use affine transformation
2023-03-10 12:36:39 +01:00
Chad Brokaw
d12b711fe1
premultiply alpha before filtering
2023-03-10 02:04:21 -05:00
Chad Brokaw
a8585781cd
move atlas rect to info
...
Atlas offset and image size were originally stored in the ptcl but are not tile dependent. Moving these to info saves 8 bytes per image tile.
2023-03-10 01:42:50 -05:00
Chad Brokaw
165b3a083b
Let's add images
2023-03-09 17:18:03 -05:00
msiglreith
6c4194848f
improve code formatting
2023-03-09 18:45:56 +01:00
msiglreith
5aaf288d1c
vello_svg: Use affine transformation instead of transforming the path data
...
Correctly apply the transformation for other parameters as well (e.g stroke width)
2023-03-08 19:22:16 +01:00
Chad Brokaw
2f268d4e0f
Merge pull request #284 from linebender/glyph-run
...
Glyph run API
2023-03-06 18:39:16 -05:00
Chad Brokaw
86b1a66af0
Address review feedback
...
* reorganize GlyphCache::get_or_insert() to use the HashMap entry API
* change DrawGlyphs::hint() parameter name from `yes` to `hint` for clarity
* change Layout::path_data() to return bytes instead of [f32; 2]. Path segments could be encoded as i16, making this incorrect
2023-03-06 18:29:43 -05:00
Chad Brokaw
69dd838d09
post rebase fixups
2023-03-06 11:41:12 -05:00
Chad Brokaw
5e06a4f1c1
update peniko dependency for Sync + Send on Blob
2023-03-06 11:12:23 -05:00
Chad Brokaw
5e216adfa8
Merge branch 'main' into glyph-run
2023-03-06 08:17:45 -05:00
Daniel McNab
5156447346
Make the with_winit
example run on android ( #273 )
2023-03-05 11:33:30 +00:00
Chad Brokaw
15efb8b3f6
fixes after rebase
...
* remove SceneBuilder::finish() calls
* remove old Config struct
* comment about syncing structs in config.wgsl
2023-03-03 20:46:50 -05:00
Chad Brokaw
fca106a5ce
Merge branch 'main' into glyph-run
2023-03-03 20:30:10 -05:00