Repository navigation
Conversation
Updates the bsn example to show how a EntityTemplate can be passed around functions and store in a component for later use
Clearing up the text in the "Named Entity Reference" section in bevy_scene docs and adding a few more examples on how this can be used
|
Welcome, new contributor! Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨ |
Fixes bevyengine#18018. `Option<T>` provides `Default` in Rust regardless of whether `T` implements `Default`, but Bevy wasn't registering `ReflectDefault`. This PR adds `#[reflect(Default)]` to `Option<T>`. AI assistance: Codex (investigation, implementation, testing, and copyediting of this description). --------- Co-authored-by: François Mockers <francois.mockers@vleue.com>
bevyengine#26090) …st's # Objective - Fixes bevyengine#26087 - Bevy keeps a GPU buffer of per-mesh dataa (MeshUniform). The shader expects each entry to be 176 bytes. Bevy worked out each entry's size by asking Rust how big the struct is, not how big the shader says it is. Normally both answers are 176, but w/ glam's scalar-math feature on, Rust packs the struct tighter, to 168 bytes. If a render phase draws exactly one mesh, the buffer comes out 168 bytes when the shader needs at least 176, and wgpu throws the binding-size error. With two or more meshes the buffer happens to be big enough, so the bug stays hidden. ## Solution - UninitBufferVec now uses the shader's size for each entry instead of Rust's (one line change boi) ## Testing - A unit test with a struct that's 12 bytes in Rust but 16 in a shader. It fails before the fix and passes after.
mnmaita
left a comment
There was a problem hiding this comment.
Doc changes look great and I like you showcased passing Entity templates to functions! Take a look at some of the comments I left, thanks!
Co-authored-by: Martín Maita <47983254+mnmaita@users.noreply.github.com>
thanks for the review! I agree with the sugesttions and already accepted. About the unrelated files, This is my first contribution for a OpenSource codebase. I think I clicked something that merge a few commits that happened in between syncing my branch and writing the PR. There is a option for delete those files, by I'm afraid it will commit a deletion of those files from the code base. Let me know if there is something I can do 😅 |
If you only intend to use the fork to push contributions I'd recommend to always keep your fork's "main" branch in sync with bevy's "main" (there's a handy button in GitHub now to accomplish this), then create new branches off of of it for pushing experimental changes or for feature branches/pull requests. If you need help with this I can write down some steps and commands for you sometime later. |
alice-i-cecile
left a comment
There was a problem hiding this comment.
Docs look helpful but the extra files need to be cleaned up :) Force-pushing is fine here.
|
I correct the extra files but had to open a new PR #26179. I'll close this one. Sorry about the mess and thank you for the patience" |
Objective
Improve clarity around Named Entity References, how to pass the EntityTemplate around and storing the entity in a Component
Solution
Named Entity Referencein bevy_scene docs, making the text clearer,EntityTemplategenerated, how to pass it to functions and how to store the entity generated in a componentscene/bsn.rsexample.Testing
bsnexamples with no error and no warnings.