Add padding for color_plane widget for wasm/webgl compat#22724
Add padding for color_plane widget for wasm/webgl compat#22724mitchty wants to merge 1 commit intobevyengine:mainfrom
Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
|
You can refer to #22357 for naming |
|
Awesome I'll have a squizz later today when I get a chance and will mimic the correct naming convention thanks @rparrett ! I was more wondering what the uniform struct naming convention in wgsl is. I just guessed a terrible name hoping someone would tell me a better one. |
ickshonpe
left a comment
There was a problem hiding this comment.
Looks good, the crash is fixed, seems to run perfectly now.
e91dd9b to
20644d7
Compare
|
Ok updated the pr with the new names, and added bevy_feathers to bevy_internal for webgpu and webgl feature passing. The cfg attributes seem to work when I tested against bevy with webgl2 and webgpu with this fix in place still. |
20644d7 to
8dc4ae6
Compare
8dc4ae6 to
b1650b6
Compare
|
Not sure on the check-bans if its related to my adding feathers to bevy_internal or not or if I should go spelunking through dependency chains or not? The first iteration of this didn't hit this not sure what would cause it with a few rebases. https://github.com/bevyengine/bevy/actions/runs/21460165775/job/61810538387?pr=22724#step:5:4825 |
It's nothing you did. I think this should fix itself if you just merge this PR with main, hopefully. |
Added bevy_feathers to webgpu and webgl cargo feature passing.
b1650b6 to
4bfb255
Compare
|
@ickshonpe Looks like that was it, though I rebased to origin/main so that last compare's a doozy 🫠 Lets see if something else breaks 🍿 |
Objective
The new bevy feathers color plane widget throws out wgpu alignment issues for the f32 in use. To enable wasm builds to use this widget add padding similar to the existing shaders/materials.
Note this is my first contribution, I yolo'd names and whatnot so if the names I chose suck I can change them I'm not wedded to the names.
Solution
Add a Vec3 padding to the uniform and material struct to pad to 16 bytes on wasm builds.
Testing
Yep built before/after in linux (wayland though I could test X if pressed), macos, and windows. Those all continued to work as expected as they did before. And tested in wasm on safari/firefox/chrome (mostly latest versions I think of those) where all 3 couldn't render the shader widget with this fix in place as a cargo patch its all good and works the same as the native builds.
Maybe? I'm not sure I know enough to speak with any authority to that. I literally never program for the web this is all a fun side project in wasm for me and I honestly don't know if I did this jazz right or not. Real web programmers should yea/nay these bits I'm just a tourist.
Just test/build on wasm with the color widget in place. All I did was use cargo patch to point to the fixed version like so:
Same patch against 0.18.1 release branch:
This branch:
I tried testing on all the systems I setup cross compilation for which is most of em methinks/mehopes.