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.
It has been very difficult to get wgpu to work (especially on older devices), so I'm sharing my result.
Now that Android and WASM support has improved in all crates, I managed to support all platforms with the latest crate versions.
I know the intention of this repository is Android, but I believe having a ready-to-go example with cross-platform instructions is critical to support both developers and libraries on this new platform.
Unfortunately I don't have time to update all examples, but I think it's best to at least update this one for now.
I'm not sure about the web-sys features but it seems to support webgl and webgpu like this.
I set present_mode to fifo and alpha_mode to opaque, because that's what worked on my Android 8.1 device and is probably more widely supported. I left the other options commented out.
I also moved the rendering to App. Perhaps App should also get an input(event) and tick/update() function.
I also introduced WGPU_BACKEND as a compile time variable.
I also commented out the unnecessary request_redraw, with a comment that one could use it for animation.