Daniel McNab
6d57093cc2
Add GPU profiling ( #304 )
...
* Add GPU profiling
* Fix conditional compilation for `headless`
* Add full profiling
* Productionise
* Fix MacOS trace file
* Try to make it easier to tell what's important
* Resolve CI issues
2023-06-01 16:10:27 +01:00
Raph Levien
4fcc348940
Change to caniuse for webgpu
2023-06-01 06:59:53 -07:00
Raph Levien
f60cb0c31b
Merge branch 'main' into failure
2023-05-31 17:37:43 -07:00
Raph Levien
3774928b24
Enforce clippy lints
...
This turns on clippy checking and also fixes all lints in the code.
Many lints are obvious improvements. Only a small number are slightly annoying, so I think overall worth having a vanilla default config.
2023-05-18 16:13:32 -07:00
Raph Levien
8eb02ce330
Suppress one more warning in wasm case
2023-05-18 15:45:44 -07:00
Raph Levien
f3587b1240
Merge branch 'main' into failure
2023-05-18 11:14:22 -07:00
Daniel McNab
abfe9fbb56
Add a stats display for scene complexity ( #322 )
2023-05-18 18:50:57 +01:00
Raph Levien
1b3938e54f
Clean up casting
...
Get rid of unneeded clone and make syntax nicer.
2023-04-29 08:22:49 -07:00
Raph Levien
e7c7f10524
Cargo fmt
2023-04-29 08:19:28 -07:00
Raph Levien
9c7e084239
Focus canvas on setup
2023-04-29 08:19:01 -07:00
Raph Levien
6fc1ed8e13
Cargo fmt
2023-04-29 08:16:28 -07:00
Raph Levien
f4a2fc616b
Mmark example
...
This commit ports the mmark example from the mmark branch, and also makes the complexity adjustable through up/down arrow keys.
2023-04-29 07:55:31 -07:00
Raph Levien
8a083d9473
Nicer HTML
...
It's easier with innerHTML rather than constructing DOM by hand.
2023-04-28 14:33:24 -07:00
Raph Levien
e399f4792d
Display error message when WebGPU not enabled
...
Detect the case where creating the WebGPU surface fails, and insert a message explaning the failure into the DOM, rather than panicking.
2023-04-28 13:55:24 -07:00
Arman Uguray
4642fa024f
[with_winit] Set the canvas size to thw winit Window's inner size
...
This prevents the scaling caused by the hardcoded canvas dimensions on
high dpi platforms.
2023-04-23 12:02:39 -07:00
Arman Uguray
5543ad01fe
[examples] Use instant crate's time::Instant
...
crates.io/crates/instant provides a std::time::Instant implementation
that works on both WASM and non-wasm builds.
2023-04-23 12:02:39 -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
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
165b3a083b
Let's add images
2023-03-09 17:18:03 -05:00
Chad Brokaw
69dd838d09
post rebase fixups
2023-03-06 11:41:12 -05:00
Daniel McNab
5156447346
Make the with_winit
example run on android ( #273 )
2023-03-05 11:33:30 +00:00