Skip to content

Commit

Permalink
Fixed bevy 0.14 merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RedMindZ committed Jul 27, 2024
1 parent 717410b commit e8fc748
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 72 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl ExecutorState {
// we must only add the system to the unapplied systems after it has
// executed, since otherwise we would apply it twice.
self.unapplied_systems.push(system_index);
break;
break;
}

// SAFETY:
Expand All @@ -453,8 +453,8 @@ impl ExecutorState {
unsafe {
self.spawn_system_task(context, system_index);
}
self.unapplied_systems.push(system_index);
}
self.unapplied_systems.push(system_index);
}

// give back
Expand Down
21 changes: 3 additions & 18 deletions crates/bevy_input/src/button_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,24 +244,9 @@ where

/// Returns `true` if any item in `inputs` has just been pressed or repeated.
pub fn any_just_pressed_or_repeated(&self, inputs: impl IntoIterator<Item = T>) -> bool {
inputs.into_iter().any(|it| self.just_pressed_or_repeated(it))
}

/// Clears the `just_pressed_or_repeated` state of the `input` and returns `true` if the `input` has just been pressed or repeated.
///
/// Future calls to [`Input::just_pressed_or_repeated`] for the given input will return false until a new press event occurs.
pub fn clear_just_pressed_or_repeated(&mut self, input: T) -> bool {
self.just_pressed_or_repeated.remove(&input)
}

/// Returns `true` if the `input` has just been pressed or repeated.
pub fn just_pressed_or_repeated(&self, input: T) -> bool {
self.just_pressed_or_repeated.contains(&input)
}

/// Returns `true` if any item in `inputs` has just been pressed or repeated.
pub fn any_just_pressed_or_repeated(&self, inputs: impl IntoIterator<Item = T>) -> bool {
inputs.into_iter().any(|it| self.just_pressed_or_repeated(it))
inputs
.into_iter()
.any(|it| self.just_pressed_or_repeated(it))
}

/// Clears the `just_pressed_or_repeated` state of the `input` and returns `true` if the `input` has just been pressed or repeated.
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ use bevy_utils::prelude::default;
pub use extract_param::Extract;

use bevy_hierarchy::ValidParentCheckPlugin;
use extract_resource::ExtractResourcePlugin;
use globals::GlobalsPlugin;
use render_asset::RenderAssetBytesPerFrame;
use renderer::{RenderAdapter, RenderAdapterInfo, RenderDevice, RenderQueue};
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_render/src/pipelined_rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ fn renderer_extract(app_world: &mut World, _world: &mut World) {
})
.pop()
.unwrap()
.unwrap()
};

{
Expand Down
99 changes: 47 additions & 52 deletions crates/bevy_render/src/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,58 +846,53 @@ pub fn prepare_view_targets(
_ => Some(clear_color_global.0),
};

let (a, b, sampled, main_texture) = textures
.entry((camera.target.clone(), view.hdr))
.or_insert_with(|| {
let descriptor = TextureDescriptor {
label: None,
size,
mip_level_count: 1,
sample_count: 1,
dimension: TextureDimension::D2,
format: main_texture_format,
usage: texture_usage.0,
view_formats: match main_texture_format {
TextureFormat::Bgra8Unorm => &[TextureFormat::Bgra8UnormSrgb],
TextureFormat::Rgba8Unorm => &[TextureFormat::Rgba8UnormSrgb],
_ => &[],
},
};
let a = texture_cache.get(
&render_device,
TextureDescriptor {
label: Some("main_texture_a"),
..descriptor
},
);
let b = texture_cache.get(
&render_device,
TextureDescriptor {
label: Some("main_texture_b"),
..descriptor
},
);
let sampled = if msaa.samples() > 1 {
let sampled = texture_cache.get(
&render_device,
TextureDescriptor {
label: Some("main_texture_sampled"),
size,
mip_level_count: 1,
sample_count: msaa.samples(),
dimension: TextureDimension::D2,
format: main_texture_format,
usage: TextureUsages::RENDER_ATTACHMENT,
view_formats: descriptor.view_formats,
},
);
Some(sampled)
} else {
None
};
let main_texture = Arc::new(AtomicUsize::new(0));
(a, b, sampled, main_texture)
});
let (a, b, sampled, main_texture) = textures
.entry((camera.target.clone(), view.hdr))
.or_insert_with(|| {
let descriptor = TextureDescriptor {
label: None,
size,
mip_level_count: 1,
sample_count: 1,
dimension: TextureDimension::D2,
format: main_texture_format,
usage: texture_usage.0,
view_formats: match main_texture_format {
TextureFormat::Bgra8Unorm => &[TextureFormat::Bgra8UnormSrgb],
TextureFormat::Rgba8Unorm => &[TextureFormat::Rgba8UnormSrgb],
_ => &[],
},
};
let a = texture_cache.get(
&render_device,
TextureDescriptor {
label: Some("main_texture_a"),
..descriptor
},
);
let b = texture_cache.get(
&render_device,
TextureDescriptor {
label: Some("main_texture_b"),
..descriptor
},
);
let sampled = if msaa.samples() > 1 {
let sampled = texture_cache.get(
&render_device,
TextureDescriptor {
label: Some("main_texture_sampled"),
sample_count: msaa.samples(),
..descriptor
},
);
Some(sampled)
} else {
None
};
let main_texture = Arc::new(AtomicUsize::new(0));
(a, b, sampled, main_texture)
});

let converted_clear_color = clear_color.map(|color| color.into());

Expand Down

0 comments on commit e8fc748

Please sign in to comment.