Skip to content

Conversation

@grind086
Copy link
Contributor

Objective

If you want to use a TilemapChunk (or more generally use a texture2DArray in a shader), you have to implement a mechanism that waits for your texture to load, then calls Image::reinterpret_stacked_2d_as_array.

Solution

Have the loader do it instead.

Testing

  • Ran the updated examples

Showcase

let array_texture = asset_server.load_with_settings(
    "textures/array_texture.png",
    |settings: &mut ImageLoaderSettings| {
        settings.array_layout = Some(ImageArrayLayout::RowCount(4));
    },
);

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 27, 2025
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.

I like this change! A few things:

  • I think we can make the enum clearer
  • this is a neat change, but not splashy enough for a release note
  • this needs a short migration guide for the new field on ImageLoaderSettings

@alice-i-cecile alice-i-cecile added the M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Oct 27, 2025
@github-actions
Copy link
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes.

@KirmesBude
Copy link
Contributor

This tries to do something similar. At least the motivation is the same #20799

@grind086
Copy link
Contributor Author

I went ahead and applied the suggested changes, but I would be fine closing in favor of #20799 if you'd prefer that one.

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 D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants