Fix asset extraction for GpuAutoExposureCompensationCurve#22803
Merged
alice-i-cecile merged 3 commits intobevyengine:mainfrom Feb 6, 2026
Merged
Fix asset extraction for GpuAutoExposureCompensationCurve#22803alice-i-cecile merged 3 commits intobevyengine:mainfrom
GpuAutoExposureCompensationCurve#22803alice-i-cecile merged 3 commits intobevyengine:mainfrom
Conversation
kfc35
approved these changes
Feb 4, 2026
Contributor
kfc35
left a comment
There was a problem hiding this comment.
Looks like a straightforward fix. Approving for correctness
greeble-dev
suggested changes
Feb 4, 2026
Contributor
greeble-dev
left a comment
There was a problem hiding this comment.
This was accidentally regressed by #21732. Fix seems good and I've tested before/after. Just requesting one change to make the fix smaller.
crates/bevy_post_process/src/auto_exposure/compensation_curve.rs
Outdated
Show resolved
Hide resolved
Contributor
|
Adding to 0.18.1 milestone as this was a regression from 0.17 -> 0.18. |
greeble-dev
approved these changes
Feb 5, 2026
alice-i-cecile
pushed a commit
that referenced
this pull request
Mar 2, 2026
# Objective
- When I am running the example `auto_exposure` on the main branch. I
get errors, and the auto exposure effect does not work correctly.
```
2026-02-04T05:36:29.462198Z ERROR bevy_render::render_asset: bevy_post_process::auto_exposure::compensation_curve::GpuAutoExposureCompensationCurve with RenderAssetUsages == RENDER_WORLD cannot be extracted: The asset type does not support extraction. To clone the asset to the renderworld, use `RenderAssetUsages::default()`
2026-02-04T05:36:29.462407Z ERROR bevy_render::render_asset: bevy_post_process::auto_exposure::compensation_curve::GpuAutoExposureCompensationCurve with RenderAssetUsages == RENDER_WORLD cannot be extracted: The asset type does not support extraction. To clone the asset to the renderworld, use `RenderAssetUsages::default()`
```
- I believe the reason is that` GpuAutoExposureCompensationCurve` is
missing the `take_gpu_data` function from the `RenderAsset` trait.
- The code snippet that outputs error information
`(crates\bevy_render\src\render_asset.rs)`.
``` rust
for id in needs_extracting.drain() {
if let Some(asset) = assets.get(id) {
let asset_usage = A::asset_usage(asset);
if asset_usage.contains(RenderAssetUsages::RENDER_WORLD) {
if asset_usage == RenderAssetUsages::RENDER_WORLD {
if let Some(asset) = assets.get_mut_untracked(id) {
let previous_asset = maybe_render_assets.as_ref().and_then(|render_assets| render_assets.get(id));
match A::take_gpu_data(asset, previous_asset) {
Ok(gpu_data_asset) => {
extracted_assets.push((id, gpu_data_asset));
added.insert(id);
}
Err(e) => {
error!("{} with RenderAssetUsages == RENDER_WORLD cannot be extracted: {e}", core::any::type_name::<A>());
}
};
}
} else {
extracted_assets.push((id, asset.clone()));
added.insert(id);
}
}
}
}
```
## Solution
- Add `take_gpu_data()` function.
## Testing
- The example `auto_exposure` works correctly.
- CI
---
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
auto_exposureon the main branch. I get errors, and the auto exposure effect does not work correctly.I believe the reason is that
GpuAutoExposureCompensationCurveis missing thetake_gpu_datafunction from theRenderAssettrait.The code snippet that outputs error information
(crates\bevy_render\src\render_asset.rs).Solution
take_gpu_data()function.Testing
auto_exposureworks correctly.