From d942589108ee4ba8b5641add08d1cadc6356e052 Mon Sep 17 00:00:00 2001 From: janis Date: Thu, 22 Oct 2026 20:13:58 +0200 Subject: [PATCH] update dependencies --- Cargo.toml | 42 ++++---- assets/fonts/.gitignore | 2 + assets/fonts/fetch.sh | 4 + .../bevy_vulkan_render/src/extract_param.rs | 17 +--- crates/bevy_vulkan_render/src/sync_world.rs | 98 +++++++++++++------ crates/bevy_vulkan_render/src/window/mod.rs | 17 ++-- crates/game/src/main.rs | 5 +- crates/renderer/src/instance.rs | 2 +- crates/renderer/src/lib.rs | 1 + crates/text/src/lib.rs | 2 +- 10 files changed, 114 insertions(+), 76 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b822d89..0f3d9d4 100644 --- a/Cargo.toml +++ b/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,23 +68,23 @@ 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" -path = "examples/bevy_integration.rs" \ No newline at end of file +path = "examples/bevy_integration.rs" diff --git a/assets/fonts/.gitignore b/assets/fonts/.gitignore index d259f05..d892ff9 100644 --- a/assets/fonts/.gitignore +++ b/assets/fonts/.gitignore @@ -1 +1,3 @@ *.ttf +!Roboto/Roboto-VariableFont_wdth,wght.ttf +!Noto_Sans_SC/NotoSansSC-VariableFont_wght.ttf diff --git a/assets/fonts/fetch.sh b/assets/fonts/fetch.sh index f64a534..eac7e43 100755 --- a/assets/fonts/fetch.sh +++ b/assets/fonts/fetch.sh @@ -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 diff --git a/crates/bevy_vulkan_render/src/extract_param.rs b/crates/bevy_vulkan_render/src/extract_param.rs index bd47807..0b4698e 100644 --- a/crates/bevy_vulkan_render/src/extract_param.rs +++ b/crates/bevy_vulkan_render/src/extract_param.rs @@ -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::::init_access( - &state.main_world_state, - system_meta, - component_access_set, - world, - ); + system_access: &mut SystemAccess, + ) -> Result<(), SystemParamAccessConflict> { + Res::::init_access(&state.main_world_state, system_meta, system_access) } #[inline] diff --git a/crates/bevy_vulkan_render/src/sync_world.rs b/crates/bevy_vulkan_render/src/sync_world.rs index 382d9b8..b374de1 100644 --- a/crates/bevy_vulkan_render/src/sync_world.rs +++ b/crates/bevy_vulkan_render/src/sync_world.rs @@ -93,12 +93,12 @@ impl Plugin for SyncWorldPlugin { fn build(&self, app: &mut bevy_app::App) { app.init_resource::(); app.add_observer( - |add: On, mut pending: ResMut| { + |add: On>, mut pending: ResMut| { pending.push(EntityRecord::Added(add.entity)); }, ); app.add_observer( - |remove: On, + |remove: On>, mut pending: ResMut, 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::(); main_world.add_observer( - |add: On, mut pending: ResMut| { + |add: On>, mut pending: ResMut| { pending.push(EntityRecord::Added(add.entity)); }, ); main_world.add_observer( - |remove: On, + |remove: On>, mut pending: ResMut, query: Query<&RenderEntity>| { if let Ok(e) = query.get(remove.entity) { diff --git a/crates/bevy_vulkan_render/src/window/mod.rs b/crates/bevy_vulkan_render/src/window/mod.rs index 63a074e..9d6b95f 100644 --- a/crates/bevy_vulkan_render/src/window/mod.rs +++ b/crates/bevy_vulkan_render/src/window/mod.rs @@ -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, configured: HashSet, @@ -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>, windows: Extract)>>, mut removed: Extract>, - mut surfaces: ResMut, + mut surfaces: NonSendMut, ) { 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, - surfaces: Res, + surfaces: NonSend, ) -> bool { windows .windows @@ -126,7 +129,7 @@ pub(crate) fn need_surface_configuration( pub(crate) fn configure_surfaces( windows: Res, - mut surfaces: ResMut, + mut surfaces: NonSendMut, device: Res, ) { for window in windows.windows.values() { diff --git a/crates/game/src/main.rs b/crates/game/src/main.rs index 7faf8d3..bbb8138 100644 --- a/crates/game/src/main.rs +++ b/crates/game/src/main.rs @@ -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, diff --git a/crates/renderer/src/instance.rs b/crates/renderer/src/instance.rs index 60945ff..afb3720 100644 --- a/crates/renderer/src/instance.rs +++ b/crates/renderer/src/instance.rs @@ -338,7 +338,7 @@ impl Instance { }) } - pub(crate) fn choose_adapter_default( + pub fn choose_adapter_default( &self, surface: Option<&Surface>, required_extensions: &[Extension], diff --git a/crates/renderer/src/lib.rs b/crates/renderer/src/lib.rs index f693353..422e11e 100644 --- a/crates/renderer/src/lib.rs +++ b/crates/renderer/src/lib.rs @@ -2,6 +2,7 @@ negative_impls, map_try_insert, debug_closure_helpers, + core_io, core_io_borrowed_buf, slice_partition_dedup )] diff --git a/crates/text/src/lib.rs b/crates/text/src/lib.rs index 6e218f1..912182f 100644 --- a/crates/text/src/lib.rs +++ b/crates/text/src/lib.rs @@ -42,7 +42,7 @@ impl std::fmt::Debug for FontData { } } -#[derive(Debug, Default)] +#[derive(Debug, Default, TypePath)] struct FontLoader; #[derive(thiserror::Error, Debug)]