Bevy version and features
0.20.0-rc.1.
[Optional] Relevant system information
macOS 15.6 (Darwin 24.6.0), Apple Silicon, Metal. Native build.
What you did
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, |mut commands: Commands| {
commands.spawn(Camera2d);
commands.spawn(Sprite::from_color(Color::WHITE, Vec2::splat(100.0)));
})
.run();
}
What went wrong
A warning at startup:
WARN bevy_shader::shader_cache: Shader `embedded://bevy_sprite_render/sprite_mesh/sprite_material.wesl` has an unresolved import:
error: module not found: `bevy_sprite_render::mesh2d::bindings` (no shader registered for this module path)
|
= note: in bevy_sprite_render::sprite_mesh::sprite_material (embedded://bevy_sprite_render/sprite_mesh/sprite_material.wesl)
The sprite renders correctly. The warning is spurious: the import resolves on a later frame.
Additional information
Since #25432, every Sprite is drawn through SpriteMaterial, whose shader imports mesh2d::bindings. That module is not registered at build time: load_mesh2d_bindings loads it through the asset server in RenderStartup, because its shader defs depend on the device's limits. When the sprite pipeline is first queued before that load finishes, ShaderCache hits ModuleNotFound, warns once, and returns ShaderImportNotYetAvailable, and the pipeline succeeds on a later retry.
See also #25363.
Disclosure: some parts of this issue were generated by Claude Opus 5.5 and then manually edited.
Bevy version and features
0.20.0-rc.1.
[Optional] Relevant system information
macOS 15.6 (Darwin 24.6.0), Apple Silicon, Metal. Native build.
What you did
What went wrong
A warning at startup:
The sprite renders correctly. The warning is spurious: the import resolves on a later frame.
Additional information
Since #25432, every
Spriteis drawn throughSpriteMaterial, whose shader importsmesh2d::bindings. That module is not registered at build time:load_mesh2d_bindingsloads it through the asset server inRenderStartup, because its shader defs depend on the device's limits. When the sprite pipeline is first queued before that load finishes,ShaderCachehitsModuleNotFound, warns once, and returnsShaderImportNotYetAvailable, and the pipeline succeeds on a later retry.See also #25363.
Disclosure: some parts of this issue were generated by Claude Opus 5.5 and then manually edited.