Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes a panic #1035

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions crates/bevy_render/src/shader/shader_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ pub fn asset_shader_defs_system<T: Asset>(
T: ShaderDefs + Send + Sync + 'static,
{
for (asset_handle, mut render_pipelines) in query.iter_mut() {
let shader_defs = assets.get(asset_handle).unwrap();
for shader_def in shader_defs.iter_shader_defs() {
for render_pipeline in render_pipelines.pipelines.iter_mut() {
render_pipeline
.specialization
.shader_specialization
.shader_defs
.insert(shader_def.to_string());
if let Some(asset_handle) = assets.get(asset_handle) {
let shader_defs = asset_handle;
for shader_def in shader_defs.iter_shader_defs() {
for render_pipeline in render_pipelines.pipelines.iter_mut() {
render_pipeline
.specialization
.shader_specialization
.shader_defs
.insert(shader_def.to_string());
}
}
}
}
Expand Down