Skip to content

Solari: Fix removed RaytracingMesh3d component#24764

Open
JMS55 wants to merge 3 commits into
bevyengine:mainfrom
JMS55:solari7-fix-removed-rt-mesh
Open

Solari: Fix removed RaytracingMesh3d component#24764
JMS55 wants to merge 3 commits into
bevyengine:mainfrom
JMS55:solari7-fix-removed-rt-mesh

Conversation

@JMS55

@JMS55 JMS55 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #24042.

@JMS55 JMS55 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior labels Jun 26, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jun 26, 2026
@kfc35

kfc35 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Any reason why this isn’t using the SyncComponentPlugin stuff? like:
SyncComponentPlugin::<RaytracingMesh3d, Self>::default()

https://docs.rs/bevy/latest/bevy/render/sync_component/struct.SyncComponentPlugin.html
https://github.com/bevyengine/bevy/blob/main/crates/bevy_render/src/sync_component.rs#L48-L63

@kfc35 kfc35 added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Jun 29, 2026
@JMS55

JMS55 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

I don't really get how/when to use SyncComponentPlugin tbh.

@kfc35

kfc35 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

I don't really get how/when to use SyncComponentPlugin tbh.

From what I understand, you just need to add the plugin on the app and it should just work. I think I'd place it in the RaytracingScenePlugin since the RaytracingMesh3d component is manually extracted in extract_raytracing_scene.

I’m only familiar with this cause lights are set up with their own SyncComponentPlugin’s so I was able to remove manual removal code that had to deal with lights like this. Lights are manually extracted so they don’t use the ExtractComponentPlugin, but they have SyncComponentPlugins to manage any cleanup that needs to happen.impl SyncComponent is only necessary if there are additional components that should be removed when the main world counterpart is removed. @kristoff3r can probably explain more / verify if what I said is correct (author of #22766 )

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 29, 2026
@kristoff3r

kristoff3r commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

I don't really get how/when to use SyncComponentPlugin tbh.

From what I understand, you just need to add the plugin on the app and it should just work. I think I'd place it in the RaytracingScenePlugin since the RaytracingMesh3d component is manually extracted in extract_raytracing_scene.

I’m only familiar with this cause lights are set up with their own SyncComponentPlugin’s so I was able to remove manual removal code that had to deal with lights like this. Lights are manually extracted so they don’t use the ExtractComponentPlugin, but they have SyncComponentPlugins to manage any cleanup that needs to happen.impl SyncComponent is only necessary if there are additional components that should be removed when the main world counterpart is removed. @kristoff3r can probably explain more / verify if what I said is correct (author of #22766 )

That is correct. Just like ExtractComponentPlugin is a helper for extraction, SyncComponentPlugin is a helper for removal. If you use the ExtractComponent derive it can also be used from there, see https://docs.rs/bevy/latest/bevy/render/extract_component/derive.ExtractComponent.html

Edit: In this case I think it's fine, this is easier than using the SyncComponent machinery. My hope is that some day we'll have ergonomic ways to handle all the extraction cases that come with syncing included, and at that point we can remove all the ad-hoc stuff and be free from retained render world errors forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

[Solari] Removing RaytracingMesh3d does not delete the render-world counterpart

5 participants