Skip to content

Extract extract to bevy_extract#22852

Open
Zeophlite wants to merge 52 commits intobevyengine:mainfrom
Zeophlite:extract-extract
Open

Extract extract to bevy_extract#22852
Zeophlite wants to merge 52 commits intobevyengine:mainfrom
Zeophlite:extract-extract

Conversation

@Zeophlite
Copy link
Copy Markdown
Contributor

@Zeophlite Zeophlite commented Feb 7, 2026

Objective

  • Make the extract infra is reusable for non-rendering crates

Solution

  • Create bevy_extract

Note that this branch is a pathfinder, the actual implementation is as follows (commits will be sequentially PR'd):

Testing

  • cargo run --example animated_mesh

@Zeophlite Zeophlite requested a review from atlv24 February 7, 2026 12:46
@IQuick143 IQuick143 added the A-Rendering Drawing game state to the screen label Feb 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

You added a new feature but didn't update the readme. Please run cargo run -p build-templated-pages -- update features to update it, and commit the file change.

Copy link
Copy Markdown
Contributor

@atlv24 atlv24 left a comment

Choose a reason for hiding this comment

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

This is skipping a few steps but its roughly the goal. We need a few preparatory steps, each of these should be its own PR:

  • The resource marker change to allow orphan rule circumvention on resource impls
  • Making ExtractPlugin take the app label (RenderApp) as generic parameter instead of hardcode
  • Making ExtractPlugin take a schedule to run and having its own internal extract schedule which handles the pre and post actions, running the user provided systemset/schedule in the middle
  • improving the macro situation to hide existing complexity of implementations
  • collapse manual implementations of extract into derive macro call or whatever
  • Introducing an AppLabel marker to Extract impls to specify that they are RenderApp extract impls and tuck it away neatly into the macro
  • Rename test terminology in extract_plugin.rs to not reference rendering
  • finally, this PR

@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change X-Contentious There are nontrivial implications that should be thought through S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Feb 8, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 9, 2026
# Objective

- Followup to #22766
- Step towards #22852

## Solution

- Add marker to `ExtractResouce`
- Pass marker to `SyncComponent`

## Testing

- `cargo run --example animated_mesh`
@cart cart added this to Rendering Feb 12, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Feb 12, 2026
@Zeophlite
Copy link
Copy Markdown
Contributor Author

Zeophlite commented Feb 21, 2026

New version, extending https://github.com/atlv24/bevy/tree/ad/extract-label ( #22855 )

cargo run --example animated_mesh works now, but at reduced DX (Need to pass RenderApp around a bunch still)

continue;
};
let render_entity = commands.spawn(TemporaryRenderEntity).id();
let render_entity = commands.spawn(TemporarySubEntity).id(); // using TemporaryRenderEntity fails with expected value, found type alias `TemporaryRenderEntity`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried aliasing TemporarySubEntity as TemporaryRenderEntity, but got this error when trying to spawn.

@Zeophlite
Copy link
Copy Markdown
Contributor Author

@atlv24 could you give a steer?

@Zeophlite Zeophlite marked this pull request as ready for review March 4, 2026 16:24
@PVDoriginal PVDoriginal mentioned this pull request Mar 4, 2026
@atlv24
Copy link
Copy Markdown
Contributor

atlv24 commented Mar 15, 2026

Will do, looking into this now.

github-merge-queue bot pushed a commit that referenced this pull request Mar 15, 2026
# Objective

- Uniform handling is an application of extract components, not part of
its implementation
- Step towards #22852

## Solution

- Move uniforms out of `extract_component.rs`

## Testing

- CI
github-merge-queue bot pushed a commit that referenced this pull request Mar 16, 2026
An example demonstrating automatic and manual extraction of components
from the Main World to the Render World.

This is a common point of confusion for new users that want to do custom
rendering, and I don't think any of the current examples show how to
manually extract components (or aren't at all focused on it at least).

In the future this should probably be changed to be about extraction
between two arbitrary worlds, instead of being specific to the Render
World. Possibly after / if github.com//pull/22852 is
merged.

---------

Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
@atlv24
Copy link
Copy Markdown
Contributor

atlv24 commented Mar 18, 2026

@Zeophlite atlv24@84c8d9c

this should make it possible to extract a component to multiple worlds

I really appreciate you splitting stuff out to land independently btw, it really helps!

splo pushed a commit to splo/bevy that referenced this pull request Mar 31, 2026
# Objective

- Uniform handling is an application of extract components, not part of
its implementation
- Step towards bevyengine#22852

## Solution

- Move uniforms out of `extract_component.rs`

## Testing

- CI
splo pushed a commit to splo/bevy that referenced this pull request Mar 31, 2026
An example demonstrating automatic and manual extraction of components
from the Main World to the Render World.

This is a common point of confusion for new users that want to do custom
rendering, and I don't think any of the current examples show how to
manually extract components (or aren't at all focused on it at least).

In the future this should probably be changed to be about extraction
between two arbitrary worlds, instead of being specific to the Render
World. Possibly after / if github.com/bevyengine/pull/22852 is
merged.

---------

Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
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-Code-Quality A section of code that is hard to understand or change S-Needs-Help The author needs help finishing this PR. X-Contentious There are nontrivial implications that should be thought through

Projects

Status: Needs SME Triage
Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants