Skip to content

Make bevy_ui not depend on bevy_render #20502

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

Merged
merged 6 commits into from
Aug 12, 2025

Conversation

atlv24
Copy link
Contributor

@atlv24 atlv24 commented Aug 11, 2025

Objective

  • title

Solution

  • use the system set
  • fix the InheritWeights system set naming convention while we're at it
  • move transparent image handle uuid to bevy_image
  • move ImagePlugin to bevy_image to initialize transparent image etc
  • rename remaining plugin to TexturePlugin
  • ok technically its a dev-dep still
  • sorry this could be split up better

Testing

@atlv24 atlv24 added A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 11, 2025

// TODO: replace Texture names with Image names?
/// Adds the [`Image`] as an asset and makes sure that they are extracted and prepared for the GPU.
pub struct ImagePlugin {
Copy link
Member

Choose a reason for hiding this comment

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

Ahhh why was this even in bevy_render T_T

Copy link
Member

@alice-i-cecile alice-i-cecile 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 a step in the right direction, but why is this a dev-dep still?

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 11, 2025
@alice-i-cecile alice-i-cecile added this to the 0.17 milestone Aug 11, 2025
Copy link
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

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

Moving the sampler stuff to image is really nice 👍.

@atlv24
Copy link
Contributor Author

atlv24 commented Aug 11, 2025

This is a step in the right direction, but why is this a dev-dep still?

Because testing needs to initialize ManualTextureViews for some reason, dunno.

@atlv24
Copy link
Contributor Author

atlv24 commented Aug 11, 2025

Depends on #20506

@TimJentzsch TimJentzsch added the S-Blocked This cannot move forward until something else changes label Aug 11, 2025
@ickshonpe ickshonpe mentioned this pull request Aug 11, 2025
@ickshonpe
Copy link
Contributor

ickshonpe commented Aug 11, 2025

This is a step in the right direction, but why is this a dev-dep still?

Because testing needs to initialize ManualTextureViews for some reason, dunno.

It's just needed for the camera updates, I made a quick PR at #20512 that simplifies the UI test setup and removes the need for it.

@atlv24
Copy link
Contributor Author

atlv24 commented Aug 11, 2025

thanks for looking into that @ickshonpe ! i have been wondering if we want to move as much of camera_system's logic into bevy_camera as we can, and leave just a lil bit of it in bevy_render for resizing render target or whatever has to happen. Then we wouldnt need a test specific setup hopefully

@ickshonpe ickshonpe closed this Aug 11, 2025
@ickshonpe ickshonpe reopened this Aug 11, 2025
@ickshonpe
Copy link
Contributor

thanks for looking into that @ickshonpe ! i have been wondering if we want to move as much of camera_system's logic into bevy_camera as we can, and leave just a lil bit of it in bevy_render for resizing render target or whatever has to happen. Then we wouldnt need a test specific setup hopefully

For layout bevy_ui is almost there already. All the window and camera queries are in update_ui_context_system which collects the details (just id, size and scale factor) of the UI render targets and then propagates them via the ComputedNodeTarget component. Then the text, layout and widget systems just query for ComputedNodeTarget and don't need to know anything else. The exception is picking which is still a bit of a mess.

@atlv24 atlv24 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-Blocked This cannot move forward until something else changes S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Aug 12, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 12, 2025
Merged via the queue into bevyengine:main with commit c0eb89e Aug 12, 2025
38 checks passed
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-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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: Done
Development

Successfully merging this pull request may close these issues.

5 participants