Skip to content
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

bevy 0.15 rc #5

Merged
merged 6 commits into from
Nov 4, 2024
Merged

bevy 0.15 rc #5

merged 6 commits into from
Nov 4, 2024

Conversation

Vrixyz
Copy link
Owner

@Vrixyz Vrixyz commented Oct 31, 2024

Something is rendering! but still mostly broken.

Analysis

Entities are used all over bevy_egui to refer to items:

  • EguiPipelines
  • EguiNode
  • EguiRenderToTextureNode (let's ignore that for now)
  • EguiPass

To me, it seems that most entities should refer to render world's.

But the source to get these Entities are sometimes ExtractedWindows, which is from main world:

Questions:

Which world should our key entities be from ?

RenderEntity

Since most operations are from the render schedules, I think it makes sense to be on RenderEntity.

Not blocking: We can't use RenderEntity as a key because Eq and Hash are not derived. We could reimplement our own but it's an annoyance.
This should be fixed by bevyengine/bevy#16191

Blocking (?): When in queue_pipelines_system, our window doesn't have a RenderEntity, so it's difficult to add a RenderEntity key.

TODO: ? we could try to replace the window extract (which I believe comes from bevy), to create our own extraction logic which would occur earlier, but I fear this would result in surprises for users. (and I'm not sure it's possible).

MainEntity

So if I can´t rely on RenderEntity, let's try to rely on the Entity from main world:

EguiRenderToTextureNode::render_to_texture_target is split into 2 entities, to keep links at all times.

unfortunately this doesn´t work, I'm not sure where the error is.

I'll hunt for error handling in case of entities not found and add more debug while I think of better debugging strategy 🤔

Debugging attempt

Something is rendering! but still mostly broken.
@Vrixyz Vrixyz changed the title use RenderEntity and MainEntity bevy 0.15 rc Oct 31, 2024
src/egui_node.rs Outdated
@@ -324,7 +327,9 @@ impl Node for EguiNode {
index_offset += mesh.vertices.len() as u32;

let texture_handle = match mesh.texture_id {
egui::TextureId::Managed(id) => EguiTextureId::Managed(self.window_entity, id),
egui::TextureId::Managed(id) => {
EguiTextureId::Managed(self.window_entity_render.id(), id)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EguiTextureId::Managed is actually checked in a main world schedule ; so this should be window_entity_main !

@Vrixyz Vrixyz merged commit d096ac8 into bevy_main Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant