stop retrying removed assets (#12505)
# Objective assets that don't load before they get removed are retried forever, causing buffer churn and slowdown. ## Solution stop trying to prepare dead assets.
This commit is contained in:
parent
3a83f4e51e
commit
1323de7cd7
@ -934,6 +934,10 @@ pub fn prepare_materials<M: Material>(
|
||||
) {
|
||||
let queued_assets = std::mem::take(&mut prepare_next_frame.assets);
|
||||
for (id, material) in queued_assets.into_iter() {
|
||||
if extracted_assets.removed.contains(&id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match prepare_material(
|
||||
&material,
|
||||
&render_device,
|
||||
|
@ -402,6 +402,10 @@ pub fn prepare_assets<A: RenderAsset>(
|
||||
let mut param = param.into_inner();
|
||||
let queued_assets = std::mem::take(&mut prepare_next_frame.assets);
|
||||
for (id, extracted_asset) in queued_assets {
|
||||
if extracted_assets.removed.contains(&id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match extracted_asset.prepare_asset(&mut param) {
|
||||
Ok(prepared_asset) => {
|
||||
render_assets.insert(id, prepared_asset);
|
||||
|
@ -572,6 +572,10 @@ pub fn prepare_materials_2d<M: Material2d>(
|
||||
) {
|
||||
let queued_assets = std::mem::take(&mut prepare_next_frame.assets);
|
||||
for (id, material) in queued_assets {
|
||||
if extracted_assets.removed.contains(&id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match prepare_material2d(
|
||||
&material,
|
||||
&render_device,
|
||||
|
@ -691,6 +691,10 @@ pub fn prepare_ui_materials<M: UiMaterial>(
|
||||
) {
|
||||
let queued_assets = std::mem::take(&mut prepare_next_frame.assets);
|
||||
for (id, material) in queued_assets {
|
||||
if extracted_assets.removed.contains(&id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match prepare_ui_material(
|
||||
&material,
|
||||
&render_device,
|
||||
|
Loading…
Reference in New Issue
Block a user