update dependencies
This commit is contained in:
parent
7b6da19a77
commit
d942589108
40
Cargo.toml
40
Cargo.toml
|
|
@ -28,13 +28,13 @@ debug = true
|
|||
[workspace.dependencies]
|
||||
anyhow = "1.0.89"
|
||||
thiserror = "2.0"
|
||||
derive_more = { version = "1.0.0", features = ["deref", "debug", "deref_mut"] }
|
||||
derive_more = { version = "2", features = ["deref", "debug", "deref_mut"] }
|
||||
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = {version ="0.3", features = ["env-filter"]}
|
||||
|
||||
glam = {version = "0.29.0", features = ["bytemuck"]}
|
||||
rand = "0.9"
|
||||
glam = { version = "0.33", features = ["bytemuck"] }
|
||||
rand = "0.10"
|
||||
bitflags = "2.6"
|
||||
thread_local = "1.1.8"
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ vk-sync = "0.1.6"
|
|||
arrayvec = "0.7.6"
|
||||
tinyvec = "1.8"
|
||||
indexmap = "2"
|
||||
petgraph = "0.7"
|
||||
petgraph = "0.8"
|
||||
itertools = "0.14.0"
|
||||
ahash = "0.8"
|
||||
|
||||
|
|
@ -68,22 +68,22 @@ raw-window-handle = "0.6"
|
|||
egui = "0.32"
|
||||
egui_winit_platform = "0.27"
|
||||
|
||||
bevy = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_app = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_asset = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_derive = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_ecs = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy", features = ["multi_threaded", "trace"]}
|
||||
bevy_hierarchy = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_log = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_math = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_platform = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_reflect = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_tasks = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_time = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_transform = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_utils = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_window = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy_winit = { version = "0.19.0-dev", git = "https://github.com/bevyengine/bevy" }
|
||||
bevy = { path = "/var/code/bevy-engine/bevy" }
|
||||
bevy_app = { path = "/var/code/bevy-engine/bevy/crates/bevy_app" }
|
||||
bevy_asset = { path = "/var/code/bevy-engine/bevy/crates/bevy_asset" }
|
||||
bevy_derive = { path = "/var/code/bevy-engine/bevy/crates/bevy_derive" }
|
||||
bevy_ecs = { path = "/var/code/bevy-engine/bevy/crates/bevy_ecs", features = ["multi_threaded", "trace"]}
|
||||
bevy_hierarchy = { path = "/var/code/bevy-engine/bevy/crates/bevy_hierarchy" }
|
||||
bevy_log = { path = "/var/code/bevy-engine/bevy/crates/bevy_log" }
|
||||
bevy_math = { path = "/var/code/bevy-engine/bevy/crates/bevy_math" }
|
||||
bevy_platform = { path = "/var/code/bevy-engine/bevy/crates/bevy_platform" }
|
||||
bevy_reflect = { path = "/var/code/bevy-engine/bevy/crates/bevy_reflect" }
|
||||
bevy_tasks = { path = "/var/code/bevy-engine/bevy/crates/bevy_tasks" }
|
||||
bevy_time = { path = "/var/code/bevy-engine/bevy/crates/bevy_time" }
|
||||
bevy_transform = { path = "/var/code/bevy-engine/bevy/crates/bevy_transform" }
|
||||
bevy_utils = { path = "/var/code/bevy-engine/bevy/crates/bevy_utils" }
|
||||
bevy_window = { path = "/var/code/bevy-engine/bevy/crates/bevy_window" }
|
||||
bevy_winit = { path = "/var/code/bevy-engine/bevy/crates/bevy_winit" }
|
||||
|
||||
[[example]]
|
||||
name = "bevy_integration"
|
||||
|
|
|
|||
2
assets/fonts/.gitignore
vendored
2
assets/fonts/.gitignore
vendored
|
|
@ -1 +1,3 @@
|
|||
*.ttf
|
||||
!Roboto/Roboto-VariableFont_wdth,wght.ttf
|
||||
!Noto_Sans_SC/NotoSansSC-VariableFont_wght.ttf
|
||||
|
|
|
|||
|
|
@ -26,3 +26,7 @@ for filename in "${!FONTS[@]}"; do
|
|||
echo "Fetching $filename from $url"
|
||||
curl -L "$url" -o "$filename"
|
||||
done
|
||||
|
||||
mkdir -p Roboto Noto_Sans_SC
|
||||
cp Roboto.ttf Roboto/Roboto-VariableFont_wdth,wght.ttf
|
||||
cp NotoSansSC.ttf Noto_Sans_SC/NotoSansSC-VariableFont_wght.ttf
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ use crate::extract_plugin::MainWorld;
|
|||
use bevy_ecs::{
|
||||
change_detection::Tick,
|
||||
prelude::*,
|
||||
query::FilteredAccessSet,
|
||||
system::{
|
||||
ReadOnlySystemParam, SystemMeta, SystemParam, SystemParamItem, SystemParamValidationError,
|
||||
SystemState,
|
||||
ReadOnlySystemParam, SystemAccess, SystemMeta, SystemParam, SystemParamAccessConflict,
|
||||
SystemParamItem, SystemParamValidationError, SystemState,
|
||||
},
|
||||
world::unsafe_world_cell::UnsafeWorldCell,
|
||||
};
|
||||
|
|
@ -83,15 +82,9 @@ where
|
|||
fn init_access(
|
||||
state: &Self::State,
|
||||
system_meta: &mut SystemMeta,
|
||||
component_access_set: &mut FilteredAccessSet,
|
||||
world: &mut World,
|
||||
) {
|
||||
Res::<MainWorld>::init_access(
|
||||
&state.main_world_state,
|
||||
system_meta,
|
||||
component_access_set,
|
||||
world,
|
||||
);
|
||||
system_access: &mut SystemAccess,
|
||||
) -> Result<(), SystemParamAccessConflict> {
|
||||
Res::<MainWorld>::init_access(&state.main_world_state, system_meta, system_access)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
|
|
@ -93,12 +93,12 @@ impl Plugin for SyncWorldPlugin {
|
|||
fn build(&self, app: &mut bevy_app::App) {
|
||||
app.init_resource::<PendingSyncEntity>();
|
||||
app.add_observer(
|
||||
|add: On<Add, SyncToRenderWorld>, mut pending: ResMut<PendingSyncEntity>| {
|
||||
|add: On<Add<SyncToRenderWorld>>, mut pending: ResMut<PendingSyncEntity>| {
|
||||
pending.push(EntityRecord::Added(add.entity));
|
||||
},
|
||||
);
|
||||
app.add_observer(
|
||||
|remove: On<Remove, SyncToRenderWorld>,
|
||||
|remove: On<Remove<SyncToRenderWorld>>,
|
||||
mut pending: ResMut<PendingSyncEntity>,
|
||||
query: Query<&RenderEntity>| {
|
||||
if let Ok(e) = query.get(remove.entity) {
|
||||
|
|
@ -278,15 +278,15 @@ mod render_entities_world_query_impls {
|
|||
use super::{MainEntity, RenderEntity};
|
||||
|
||||
use bevy_ecs::{
|
||||
archetype::Archetype,
|
||||
archetype::{Archetype, ArchetypeId},
|
||||
change_detection::Tick,
|
||||
component::{ComponentId, Components},
|
||||
entity::Entity,
|
||||
query::{
|
||||
ArchetypeQueryData, FilteredAccess, IterQueryData, QueryData, ReadOnlyQueryData,
|
||||
ReleaseStateQueryData, SingleEntityQueryData, WorldQuery,
|
||||
ArchetypeQueryData, FilteredAccess, FilteredAccessSet, IterQueryData, QueryData,
|
||||
ReadOnlyQueryData, ReleaseStateQueryData, SingleEntityQueryData, WorldQuery,
|
||||
},
|
||||
storage::{Table, TableRow},
|
||||
storage::{Table, TableId, TableRow},
|
||||
world::{World, unsafe_world_cell::UnsafeWorldCell},
|
||||
};
|
||||
|
||||
|
|
@ -305,14 +305,12 @@ mod render_entities_world_query_impls {
|
|||
#[inline]
|
||||
unsafe fn init_fetch<'w, 's>(
|
||||
world: UnsafeWorldCell<'w>,
|
||||
component_id: &'s ComponentId,
|
||||
state: &'s Self::State,
|
||||
last_run: Tick,
|
||||
this_run: Tick,
|
||||
) -> Self::Fetch<'w> {
|
||||
// SAFETY: defers to the `&T` implementation, with T set to `RenderEntity`.
|
||||
unsafe {
|
||||
<&RenderEntity as WorldQuery>::init_fetch(world, component_id, last_run, this_run)
|
||||
}
|
||||
unsafe { <&RenderEntity as WorldQuery>::init_fetch(world, state, last_run, this_run) }
|
||||
}
|
||||
|
||||
const IS_DENSE: bool = <&'static RenderEntity as WorldQuery>::IS_DENSE;
|
||||
|
|
@ -320,28 +318,45 @@ mod render_entities_world_query_impls {
|
|||
#[inline]
|
||||
unsafe fn set_archetype<'w, 's>(
|
||||
fetch: &mut Self::Fetch<'w>,
|
||||
component_id: &'s ComponentId,
|
||||
state: &'s Self::State,
|
||||
archetype_id: ArchetypeId,
|
||||
archetype: &'w Archetype,
|
||||
table_id: TableId,
|
||||
table: &'w Table,
|
||||
) {
|
||||
// SAFETY: defers to the `&T` implementation, with T set to `RenderEntity`.
|
||||
unsafe {
|
||||
<&RenderEntity as WorldQuery>::set_archetype(fetch, component_id, archetype, table);
|
||||
<&RenderEntity as WorldQuery>::set_archetype(
|
||||
fetch,
|
||||
state,
|
||||
archetype_id,
|
||||
archetype,
|
||||
table_id,
|
||||
table,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn set_table<'w, 's>(
|
||||
fetch: &mut Self::Fetch<'w>,
|
||||
&component_id: &'s ComponentId,
|
||||
state: &'s Self::State,
|
||||
table_id: TableId,
|
||||
table: &'w Table,
|
||||
) {
|
||||
// SAFETY: defers to the `&T` implementation, with T set to `RenderEntity`.
|
||||
unsafe { <&RenderEntity as WorldQuery>::set_table(fetch, &component_id, table) }
|
||||
unsafe { <&RenderEntity as WorldQuery>::set_table(fetch, state, table_id, table) }
|
||||
}
|
||||
|
||||
fn update_component_access(&component_id: &ComponentId, access: &mut FilteredAccess) {
|
||||
<&RenderEntity as WorldQuery>::update_component_access(&component_id, access);
|
||||
fn update_component_access(state: &Self::State, access: &mut FilteredAccess) {
|
||||
<&RenderEntity as WorldQuery>::update_component_access(state, access);
|
||||
}
|
||||
|
||||
fn init_nested_access(
|
||||
_state: &Self::State,
|
||||
_component_access_set: &mut FilteredAccessSet,
|
||||
) -> Result<(), FilteredAccessSet> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn init_state(world: &mut World) -> ComponentId {
|
||||
|
|
@ -353,11 +368,13 @@ mod render_entities_world_query_impls {
|
|||
}
|
||||
|
||||
fn matches_component_set(
|
||||
&state: &ComponentId,
|
||||
state: &Self::State,
|
||||
set_contains_id: &impl Fn(ComponentId) -> bool,
|
||||
) -> bool {
|
||||
<&RenderEntity as WorldQuery>::matches_component_set(&state, set_contains_id)
|
||||
<&RenderEntity as WorldQuery>::matches_component_set(state, set_contains_id)
|
||||
}
|
||||
|
||||
fn update_archetypes(_state: &mut Self::State, _world: UnsafeWorldCell) {}
|
||||
}
|
||||
|
||||
// SAFETY: Component access of Self::ReadOnly is a subset of Self.
|
||||
|
|
@ -425,14 +442,12 @@ mod render_entities_world_query_impls {
|
|||
#[inline]
|
||||
unsafe fn init_fetch<'w, 's>(
|
||||
world: UnsafeWorldCell<'w>,
|
||||
component_id: &'s ComponentId,
|
||||
state: &'s Self::State,
|
||||
last_run: Tick,
|
||||
this_run: Tick,
|
||||
) -> Self::Fetch<'w> {
|
||||
// SAFETY: defers to the `&T` implementation, with T set to `MainEntity`.
|
||||
unsafe {
|
||||
<&MainEntity as WorldQuery>::init_fetch(world, component_id, last_run, this_run)
|
||||
}
|
||||
unsafe { <&MainEntity as WorldQuery>::init_fetch(world, state, last_run, this_run) }
|
||||
}
|
||||
|
||||
const IS_DENSE: bool = <&'static MainEntity as WorldQuery>::IS_DENSE;
|
||||
|
|
@ -440,28 +455,45 @@ mod render_entities_world_query_impls {
|
|||
#[inline]
|
||||
unsafe fn set_archetype<'w, 's>(
|
||||
fetch: &mut Self::Fetch<'w>,
|
||||
component_id: &ComponentId,
|
||||
state: &'s Self::State,
|
||||
archetype_id: ArchetypeId,
|
||||
archetype: &'w Archetype,
|
||||
table_id: TableId,
|
||||
table: &'w Table,
|
||||
) {
|
||||
// SAFETY: defers to the `&T` implementation, with T set to `MainEntity`.
|
||||
unsafe {
|
||||
<&MainEntity as WorldQuery>::set_archetype(fetch, component_id, archetype, table);
|
||||
<&MainEntity as WorldQuery>::set_archetype(
|
||||
fetch,
|
||||
state,
|
||||
archetype_id,
|
||||
archetype,
|
||||
table_id,
|
||||
table,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn set_table<'w, 's>(
|
||||
fetch: &mut Self::Fetch<'w>,
|
||||
&component_id: &'s ComponentId,
|
||||
state: &'s Self::State,
|
||||
table_id: TableId,
|
||||
table: &'w Table,
|
||||
) {
|
||||
// SAFETY: defers to the `&T` implementation, with T set to `MainEntity`.
|
||||
unsafe { <&MainEntity as WorldQuery>::set_table(fetch, &component_id, table) }
|
||||
unsafe { <&MainEntity as WorldQuery>::set_table(fetch, state, table_id, table) }
|
||||
}
|
||||
|
||||
fn update_component_access(&component_id: &ComponentId, access: &mut FilteredAccess) {
|
||||
<&MainEntity as WorldQuery>::update_component_access(&component_id, access);
|
||||
fn update_component_access(state: &Self::State, access: &mut FilteredAccess) {
|
||||
<&MainEntity as WorldQuery>::update_component_access(state, access);
|
||||
}
|
||||
|
||||
fn init_nested_access(
|
||||
_state: &Self::State,
|
||||
_component_access_set: &mut FilteredAccessSet,
|
||||
) -> Result<(), FilteredAccessSet> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn init_state(world: &mut World) -> ComponentId {
|
||||
|
|
@ -473,11 +505,13 @@ mod render_entities_world_query_impls {
|
|||
}
|
||||
|
||||
fn matches_component_set(
|
||||
&state: &ComponentId,
|
||||
state: &Self::State,
|
||||
set_contains_id: &impl Fn(ComponentId) -> bool,
|
||||
) -> bool {
|
||||
<&MainEntity as WorldQuery>::matches_component_set(&state, set_contains_id)
|
||||
<&MainEntity as WorldQuery>::matches_component_set(state, set_contains_id)
|
||||
}
|
||||
|
||||
fn update_archetypes(_state: &mut Self::State, _world: UnsafeWorldCell) {}
|
||||
}
|
||||
|
||||
// SAFETY: Component access of Self::ReadOnly is a subset of Self.
|
||||
|
|
@ -558,12 +592,12 @@ mod tests {
|
|||
main_world.init_resource::<PendingSyncEntity>();
|
||||
|
||||
main_world.add_observer(
|
||||
|add: On<Add, SyncToRenderWorld>, mut pending: ResMut<PendingSyncEntity>| {
|
||||
|add: On<Add<SyncToRenderWorld>>, mut pending: ResMut<PendingSyncEntity>| {
|
||||
pending.push(EntityRecord::Added(add.entity));
|
||||
},
|
||||
);
|
||||
main_world.add_observer(
|
||||
|remove: On<Remove, SyncToRenderWorld>,
|
||||
|remove: On<Remove<SyncToRenderWorld>>,
|
||||
mut pending: ResMut<PendingSyncEntity>,
|
||||
query: Query<&RenderEntity>| {
|
||||
if let Ok(e) = query.get(remove.entity) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@ use std::{
|
|||
|
||||
use bevy_ecs::{entity::EntityHashMap, prelude::*};
|
||||
use bevy_window::{PrimaryWindow, RawHandleWrapper, Window, WindowClosing};
|
||||
use renderer::{ash::vk, swapchain::WindowSurface};
|
||||
use renderer::{
|
||||
ash::vk,
|
||||
swapchain::{Surface, SwapchainConfiguration},
|
||||
};
|
||||
|
||||
use crate::{RenderDevice, extract_param::Extract};
|
||||
|
||||
|
|
@ -39,7 +42,7 @@ impl DerefMut for ExtractedWindows {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Resource)]
|
||||
#[derive(Default)]
|
||||
pub struct Surfaces {
|
||||
surfaces: EntityHashMap<SurfaceData>,
|
||||
configured: HashSet<Entity>,
|
||||
|
|
@ -57,11 +60,11 @@ impl Surfaces {
|
|||
}
|
||||
|
||||
pub struct SurfaceData {
|
||||
pub surface: WindowSurface,
|
||||
pub surface: Surface,
|
||||
}
|
||||
|
||||
impl Deref for SurfaceData {
|
||||
type Target = WindowSurface;
|
||||
type Target = Surface;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.surface
|
||||
|
|
@ -74,7 +77,7 @@ pub(crate) fn extract_windows(
|
|||
mut closing: Extract<MessageReader<WindowClosing>>,
|
||||
windows: Extract<Query<(Entity, &RawHandleWrapper, &Window, Option<&PrimaryWindow>)>>,
|
||||
mut removed: Extract<RemovedComponents<RawHandleWrapper>>,
|
||||
mut surfaces: ResMut<Surfaces>,
|
||||
mut surfaces: NonSendMut<Surfaces>,
|
||||
) {
|
||||
for (entity, handle, window, primary) in windows.iter() {
|
||||
if primary.is_some() {
|
||||
|
|
@ -116,7 +119,7 @@ pub(crate) fn extract_windows(
|
|||
|
||||
pub(crate) fn need_surface_configuration(
|
||||
windows: Res<ExtractedWindows>,
|
||||
surfaces: Res<Surfaces>,
|
||||
surfaces: NonSend<Surfaces>,
|
||||
) -> bool {
|
||||
windows
|
||||
.windows
|
||||
|
|
@ -126,7 +129,7 @@ pub(crate) fn need_surface_configuration(
|
|||
|
||||
pub(crate) fn configure_surfaces(
|
||||
windows: Res<ExtractedWindows>,
|
||||
mut surfaces: ResMut<Surfaces>,
|
||||
mut surfaces: NonSendMut<Surfaces>,
|
||||
device: Res<RenderDevice>,
|
||||
) {
|
||||
for window in windows.windows.values() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use std::collections::BTreeMap;
|
||||
|
||||
use rand::{Rng, SeedableRng};
|
||||
use rand::{RngExt, SeedableRng};
|
||||
use renderer::{
|
||||
Renderer2, render_graph,
|
||||
swapchain::{Surface, SwapchainConfiguration},
|
||||
|
|
@ -106,7 +106,8 @@ impl WinitState {
|
|||
|
||||
use renderer::ash::vk::Handle;
|
||||
let [r, g, b]: [f32; 3] =
|
||||
rand::prelude::StdRng::seed_from_u64(window.surface.raw().as_raw()).random();
|
||||
rand::prelude::StdRng::seed_from_u64(window.surface.raw().as_raw())
|
||||
.random::<[f32; 3]>();
|
||||
render_graph::clear_pass(rg, renderer::util::Rgba([r, g, b, 1.0]), framebuffer);
|
||||
egui_pre_pass(
|
||||
&dev,
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ impl Instance {
|
|||
})
|
||||
}
|
||||
|
||||
pub(crate) fn choose_adapter_default(
|
||||
pub fn choose_adapter_default(
|
||||
&self,
|
||||
surface: Option<&Surface>,
|
||||
required_extensions: &[Extension],
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
negative_impls,
|
||||
map_try_insert,
|
||||
debug_closure_helpers,
|
||||
core_io,
|
||||
core_io_borrowed_buf,
|
||||
slice_partition_dedup
|
||||
)]
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ impl std::fmt::Debug for FontData {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
#[derive(Debug, Default, TypePath)]
|
||||
struct FontLoader;
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue