From ab1caefd7423ce5266909786fa1283b23bc6b7d0 Mon Sep 17 00:00:00 2001 From: Sarthak Singh Date: Fri, 1 Jul 2022 07:42:37 -0700 Subject: [PATCH] Removed world cell from places where split multable access is not needed --- crates/bevy_pbr/src/render/light.rs | 1 - crates/bevy_sprite/src/render/mod.rs | 1 - crates/bevy_ui/src/render/pipeline.rs | 1 - examples/shader/animate_shader.rs | 3 +-- examples/shader/shader_instancing.rs | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index bf50d1a8e5fc3..2509cff2554e2 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -217,7 +217,6 @@ pub struct ShadowPipeline { // TODO: this pattern for initializing the shaders / pipeline isn't ideal. this should be handled by the asset system impl FromWorld for ShadowPipeline { fn from_world(world: &mut World) -> Self { - let world = world.cell(); let render_device = world.resource::(); let view_layout = render_device.create_bind_group_layout(&BindGroupLayoutDescriptor { diff --git a/crates/bevy_sprite/src/render/mod.rs b/crates/bevy_sprite/src/render/mod.rs index c0066482014f7..2c51bb8f5ad47 100644 --- a/crates/bevy_sprite/src/render/mod.rs +++ b/crates/bevy_sprite/src/render/mod.rs @@ -38,7 +38,6 @@ pub struct SpritePipeline { impl FromWorld for SpritePipeline { fn from_world(world: &mut World) -> Self { - let world = world.cell(); let render_device = world.resource::(); let view_layout = render_device.create_bind_group_layout(&BindGroupLayoutDescriptor { diff --git a/crates/bevy_ui/src/render/pipeline.rs b/crates/bevy_ui/src/render/pipeline.rs index 34fce8e548403..3fcfcda7338f0 100644 --- a/crates/bevy_ui/src/render/pipeline.rs +++ b/crates/bevy_ui/src/render/pipeline.rs @@ -10,7 +10,6 @@ pub struct UiPipeline { impl FromWorld for UiPipeline { fn from_world(world: &mut World) -> Self { - let world = world.cell(); let render_device = world.resource::(); let view_layout = render_device.create_bind_group_layout(&BindGroupLayoutDescriptor { diff --git a/examples/shader/animate_shader.rs b/examples/shader/animate_shader.rs index 048657c3ca9cb..ef0647cc31acf 100644 --- a/examples/shader/animate_shader.rs +++ b/examples/shader/animate_shader.rs @@ -189,11 +189,10 @@ pub struct CustomPipeline { impl FromWorld for CustomPipeline { fn from_world(world: &mut World) -> Self { - let world = world.cell(); let asset_server = world.resource::(); let shader = asset_server.load("shaders/animate_shader.wgsl"); - let render_device = world.resource_mut::(); + let render_device = world.resource::(); let time_bind_group_layout = render_device.create_bind_group_layout(&BindGroupLayoutDescriptor { label: Some("time bind group"), diff --git a/examples/shader/shader_instancing.rs b/examples/shader/shader_instancing.rs index 4d45397a72653..6bf6858678929 100644 --- a/examples/shader/shader_instancing.rs +++ b/examples/shader/shader_instancing.rs @@ -168,7 +168,6 @@ pub struct CustomPipeline { impl FromWorld for CustomPipeline { fn from_world(world: &mut World) -> Self { - let world = world.cell(); let asset_server = world.resource::(); asset_server.watch_for_changes().unwrap(); let shader = asset_server.load("shaders/instancing.wgsl");