-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WASM build #312
Merged
Merged
Fix WASM build #312
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8a35c51
Roll wgpu to 0.16
armansito 5543ad0
[examples] Use instant crate's time::Instant
armansito 4642fa0
[with_winit] Set the canvas size to thw winit Window's inner size
armansito bb117da
Enable wasm-bindgen feature of instant crate
armansito 84915dc
Use expect instead of unwrap on image format block size
armansito 7526d1c
Update run_wasm instructions
armansito bc903d1
Add check for division-by-zero in path_coarse_full
armansito 51f00fb
Fix the headless example for wgpu 0.16
armansito 1529945
Update cargo-run-wasm
DJMcNab d3c54ed
Include `--bin with_winit_bin` in run_wasm instructions
armansito b442ba5
Update wgpu version badge in README
armansito b0cc221
Add warning to README about the Bevy example's compilation status
armansito c9d7a15
Put the Warning label in its own line
armansito File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -311,8 +311,8 @@ impl Engine { | |||||
bytes, | ||||||
wgpu::ImageDataLayout { | ||||||
offset: 0, | ||||||
bytes_per_row: NonZeroU32::new( | ||||||
image_proxy.width * format.describe().block_size as u32, | ||||||
bytes_per_row: Some( | ||||||
image_proxy.width * format.block_size(None).unwrap(), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or words to that effect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
), | ||||||
rows_per_image: None, | ||||||
}, | ||||||
|
@@ -338,9 +338,7 @@ impl Engine { | |||||
&data[..], | ||||||
wgpu::ImageDataLayout { | ||||||
offset: 0, | ||||||
bytes_per_row: NonZeroU32::new( | ||||||
*width * format.describe().block_size as u32, | ||||||
), | ||||||
bytes_per_row: Some(*width * format.block_size(None).unwrap()), | ||||||
rows_per_image: None, | ||||||
}, | ||||||
wgpu::Extent3d { | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to
instant
's documentation, one of thestdweb
orwasm-bindgen
features need to be updated.I still don't have a working browser with WebGPU, so maybe this works? Perhaps
instant
's docs need updatingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I went ahead and enabled
wasm-bindgen
though AFAICT all the animated scenes still worked without it.