Fix headless asset preprocessing hang (#49)
## Summary - register Bevy's image loader explicitly in the headless asset processor - use no GPU-compressed image formats because the processor has no render device - allow PNG processing tasks to complete so `ProcessorState` reaches `Finished` Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #49.
This commit is contained in:
@@ -2,7 +2,7 @@ use bevy::{
|
|||||||
app::ScheduleRunnerPlugin,
|
app::ScheduleRunnerPlugin,
|
||||||
asset::{AssetMode, AssetPlugin, processor::AssetProcessor, processor::ProcessorState},
|
asset::{AssetMode, AssetPlugin, processor::AssetProcessor, processor::ProcessorState},
|
||||||
gltf::GltfPlugin,
|
gltf::GltfPlugin,
|
||||||
image::ImagePlugin,
|
image::{CompressedImageFormats, ImageLoader, ImagePlugin},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
tasks::block_on,
|
tasks::block_on,
|
||||||
text::TextPlugin,
|
text::TextPlugin,
|
||||||
@@ -19,6 +19,7 @@ fn main() -> ExitCode {
|
|||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.add_plugins((ImagePlugin::default(), TextPlugin, GltfPlugin::default()))
|
.add_plugins((ImagePlugin::default(), TextPlugin, GltfPlugin::default()))
|
||||||
|
.register_asset_loader(ImageLoader::new(CompressedImageFormats::NONE))
|
||||||
.add_plugins(AssetProcessingPlugin)
|
.add_plugins(AssetProcessingPlugin)
|
||||||
.add_systems(Update, finish_when_processed);
|
.add_systems(Update, finish_when_processed);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user