Skip to content

Store previous_asset in PrepareNextFrameAssets.#24205

Open
larsraph wants to merge 1 commit into
bevyengine:mainfrom
larsraph:render-asset
Open

Store previous_asset in PrepareNextFrameAssets.#24205
larsraph wants to merge 1 commit into
bevyengine:mainfrom
larsraph:render-asset

Conversation

@larsraph
Copy link
Copy Markdown

@larsraph larsraph commented May 9, 2026

Issue

In prepare_assets the previous_asset is passed to A::prepare_asset however when an asset is enqueued into the PrepareNextFrameAssets it's previous asset is removed from RenderAssets and dropped. When consuming the queue is attempts to read the value from the RenderAssets which always returns None.

Solution

This change simply stores the previous_asset in the PrepareNextFrameAssets queue.

Alternative Solution

I find it dubious that the RenderAsset has to be removed from RenderAssets in the first place. The reason given is that "we remove previous here to ensure that if we are updating the asset then any users will not see the old asset after a new asset is extracted, even if the new asset is not yet ready or we are out of bytes to write." However, I would personally expect to keep stale data until the updated data arrives. If we do that then there would be no need to store the previous asset.

Testing

  • I have not tested this... How would I go about testing this?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen A-Assets Load files from disk to use for things like images, models, and sounds labels May 9, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Assets May 9, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering May 9, 2026
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage
Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

2 participants