Removed world cell from places where split multable access is not needed (#5167)

Fixes #5109.
This commit is contained in:
SarthakSingh31 2022-07-01 17:03:32 +00:00
parent 49ff42cc69
commit cdbabb7053
5 changed files with 1 additions and 6 deletions

View file

@ -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::<RenderDevice>();
let view_layout = render_device.create_bind_group_layout(&BindGroupLayoutDescriptor {

View file

@ -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::<RenderDevice>();
let view_layout = render_device.create_bind_group_layout(&BindGroupLayoutDescriptor {

View file

@ -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::<RenderDevice>();
let view_layout = render_device.create_bind_group_layout(&BindGroupLayoutDescriptor {

View file

@ -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::<AssetServer>();
let shader = asset_server.load("shaders/animate_shader.wgsl");
let render_device = world.resource_mut::<RenderDevice>();
let render_device = world.resource::<RenderDevice>();
let time_bind_group_layout =
render_device.create_bind_group_layout(&BindGroupLayoutDescriptor {
label: Some("time bind group"),

View file

@ -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::<AssetServer>();
asset_server.watch_for_changes().unwrap();
let shader = asset_server.load("shaders/instancing.wgsl");