Update deps/fix some warnings

This commit is contained in:
griffi-gh 2024-12-11 20:56:43 +01:00
parent 0349cd53c1
commit 4d89789781
21 changed files with 397 additions and 370 deletions

645
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -8,11 +8,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1725172314,
"narHash": "sha256-BtLY9lWu/pe6/ImFwuRRRqMwLacY5AZOKA2hUHUQ64k=",
"lastModified": 1733899011,
"narHash": "sha256-SpHdn/wQ1Y4YfpJ2WJBT+nFFMSDTtbQPtgFidonsiv0=",
"owner": "nix-community",
"repo": "fenix",
"rev": "28b42d01f549c38bd165296fbcb4fe66d98fc24f",
"rev": "24b76cc6d5bebb01947ae7a3e6ac894239abc7be",
"type": "github"
},
"original": {
@ -36,11 +36,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1724819573,
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"lastModified": 1733759999,
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"type": "github"
},
"original": {
@ -60,11 +60,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1725094379,
"narHash": "sha256-TBujPMMIv8RG6BKlsBEpCln1ePmWz79xTcJOQpU2L18=",
"lastModified": 1733814336,
"narHash": "sha256-xKttEMfuf2hzcdiNQucxkvW2vCUe5e9HyfPntOcBSq0=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "914a1caab54e48a028b2407d0fe6fade89532f67",
"rev": "7b4b83ba916800dfa4b4776790fdf6771c22f82e",
"type": "github"
},
"original": {

View file

@ -14,7 +14,6 @@
outputs =
{
self,
nixpkgs,
yafas,
fenix,

View file

@ -11,8 +11,8 @@ log = "0.4"
shipyard = { version = "0.7", default-features = false, features = ["std", "proc", "thread_local"] }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
toml = "0.8"
glam = { version = "0.28", features = ["debug-glam-assert", "fast-math"] }
hashbrown = "0.14"
glam = { version = "0.29", features = ["debug-glam-assert", "fast-math"] }
hashbrown = "0.15"
nohash-hasher = "0.2"
anyhow = "1.0"
rayon = "1.10"

View file

@ -10,7 +10,7 @@ pub fn init_save_file(storages: &AllStoragesView) -> Option<IOThreadManager> {
let config = storages.borrow::<UniqueView<ConfigTable>>().unwrap();
if let Some(file_path) = &config.world.file {
log::info!("Initializing save file from {:?}", file_path);
let save = open_local_save_file(&file_path).unwrap();
let save = open_local_save_file(file_path).unwrap();
Some(IOThreadManager::new(save))
} else {
log::warn!("No save file specified, world will not be saved");
@ -31,7 +31,7 @@ pub fn save_modified(
};
ctm.run(ChunkTask::SaveChunk {
position: *position,
data: data,
data,
});
chunk.data_modified = false;
amount_saved += 1;

View file

@ -5,7 +5,7 @@ edition = "2021"
publish = false
[dependencies]
glam = { version = "0.28", features = ["debug-glam-assert", "fast-math", "serde"] }
glam = { version = "0.29", features = ["debug-glam-assert", "fast-math", "serde"] }
shipyard = { version = "0.7", default-features = false, features = ["std"] }
strum = { version = "0.26", features = ["derive"] }
num_enum = "0.7"
@ -18,7 +18,7 @@ flume = "0.11"
fastnoise-lite = { version = "1.1", features = ["std", "f64"] }
rand = { version = "0.8", default_features = false, features = ["std", "min_const_gen"] }
rand_xoshiro = "0.6"
hashbrown = { version = "0.14", features = ["serde"] }
hashbrown = { version = "0.15", features = ["serde"] }
nohash-hasher = "0.2"
bytemuck = { version = "1.14", features = ["derive"] }
static_assertions = "1.1"

View file

@ -191,6 +191,7 @@ pub fn open_local_save_file(path: &Path) -> Result<WorldSaveFile> {
.read(true)
.write(true)
.create(true)
.truncate(false)
.open(path)?
});
if save_file.file.metadata().unwrap().len() == 0 {

View file

@ -26,7 +26,9 @@ impl FixedTimestamp for Workload {
let duration = Duration::from_millis(rate_millis as u64);
(self,).into_workload().run_if(move |mut timestamps: UniqueViewMut<FixedTimestampStorage>| {
let Some(t) = timestamps.0.get_mut(&key) else {
unsafe {
timestamps.0.insert_unique_unchecked(key, Instant::now());
}
return true
};
if t.elapsed() >= duration {

View file

@ -11,30 +11,30 @@ crate-type = ["lib", "cdylib"]
[dependencies]
kubi-shared = { path = "../kubi-shared" }
kubi-logging = { path = "../kubi-logging" }
hui = { git = "https://github.com/griffi-gh/hui", rev = "121e667bdb" }
hui-wgpu = { git = "https://github.com/griffi-gh/hui", rev = "121e667bdb" }
hui-winit = { git = "https://github.com/griffi-gh/hui", rev = "121e667bdb" }
hui = { git = "https://github.com/griffi-gh/hui", rev = "1b5cdb192f39029e23c6fda199ee7982e7c85cbc" }
hui-wgpu = { git = "https://github.com/griffi-gh/hui", rev = "1b5cdb192f39029e23c6fda199ee7982e7c85cbc" }
hui-winit = { git = "https://github.com/griffi-gh/hui", rev = "1b5cdb192f39029e23c6fda199ee7982e7c85cbc" }
log = "0.4"
wgpu = { version = "0.20", features = ["webgl"] }
pollster = "0.3"
wgpu = { version = "23", features = ["webgl"] }
pollster = "0.4"
bytemuck = { version = "1.15", features = ["derive"] }
winit = { version = "0.30", features = ["android-native-activity"] }
raw-window-handle = "0.6"
glam = { version = "0.28", features = ["debug-glam-assert", "fast-math"] }
glam = { version = "0.29", features = ["debug-glam-assert", "fast-math"] }
image = { version = "0.25", default_features = false, features = ["png"] }
strum = { version = "0.26", features = ["derive"] }
hashbrown = "0.14"
hashbrown = "0.15"
nohash-hasher = "0.2"
rayon = "1.10"
shipyard = { version = "0.7", default-features = false, features = ["std", "proc", "thread_local"] }
anyhow = "1.0"
flume = "0.11"
gilrs = { version = "0.10", default_features = false, features = ["xinput"] }
gilrs = { version = "0.11", default_features = false, features = ["xinput"] }
uflow = "0.7"
postcard = { version = "1.0", features = ["alloc"] }
lz4_flex = { version = "0.11", default-features = false, features = ["std"] }
static_assertions = "1.1"
tinyset = "0.4"
tinyset = "0.5"
serde_json = { version = "1.0", optional = true } #only used for `generate_visualizer_data`
rand = { version = "0.8", features = ["alloc", "small_rng"]}
atomic = "0.6"

View file

@ -125,6 +125,6 @@ pub fn update_frustum(
transforms: View<Transform, track::All>
) {
for (camera, _) in (&mut cameras, transforms.inserted_or_modified()).iter() {
camera.frustum = Frustum::compute(&camera);
camera.frustum = Frustum::compute(camera);
}
}

View file

@ -160,7 +160,7 @@ fn process_gilrs_events(
mut active_gamepad: UniqueViewMut<ActiveGamepad>
) {
if let Some(gilrs) = &mut gilrs.0 {
while let Some(Event { id, event: _, time: _ }) = gilrs.next_event() {
while let Some(Event { id, event: _, time: _, .. }) = gilrs.next_event() {
active_gamepad.0 = Some(id);
}
}

View file

@ -7,7 +7,7 @@
#![forbid(
static_mut_refs,
unsafe_op_in_unsafe_fn,
rust_2024_compatibility,
// rust_2024_compatibility,
)]
use shipyard::{

View file

@ -28,7 +28,7 @@ pub fn init_entities_pipeline(
vertex: wgpu::VertexState {
module: &module,
compilation_options: wgpu::PipelineCompilationOptions::default(),
entry_point: "vs_main",
entry_point: Some("vs_main"),
buffers: &[
ModelVertex::LAYOUT,
InstanceData::LAYOUT,
@ -37,7 +37,7 @@ pub fn init_entities_pipeline(
fragment: Some(wgpu::FragmentState {
module: &module,
compilation_options: wgpu::PipelineCompilationOptions::default(),
entry_point: "fs_main",
entry_point: Some("fs_main"),
targets: &[Some(wgpu::ColorTargetState {
format: renderer.surface_config().format,
blend: Some(wgpu::BlendState::REPLACE),
@ -62,5 +62,6 @@ pub fn init_entities_pipeline(
}),
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
})
}

View file

@ -124,6 +124,7 @@ impl Renderer {
label: None,
required_features: wgpu::Features::empty(),
required_limits: wgpu::Limits::downlevel_webgl2_defaults().using_resolution(adapter.limits()),
memory_hints: wgpu::MemoryHints::Performance,
},
None,
).block_on().unwrap();

View file

@ -32,7 +32,7 @@ pub fn init_selection_box_pipeline(
layout: Some(&selection_box_pipeline_layout),
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: ren.surface_config().format,
@ -42,7 +42,7 @@ pub fn init_selection_box_pipeline(
}),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[
PrimitiveVertex::LAYOUT,
@ -66,5 +66,6 @@ pub fn init_selection_box_pipeline(
}),
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
})
}

View file

@ -26,7 +26,7 @@ pub fn init_smoverlay_pipeline(
vertex: wgpu::VertexState {
module: &module,
compilation_options: wgpu::PipelineCompilationOptions::default(),
entry_point: "vs_main",
entry_point: Some("vs_main"),
buffers: &[
PrimitiveVertex2::LAYOUT,
],
@ -34,7 +34,7 @@ pub fn init_smoverlay_pipeline(
fragment: Some(wgpu::FragmentState {
module: &module,
compilation_options: wgpu::PipelineCompilationOptions::default(),
entry_point: "fs_main",
entry_point: Some("fs_main"),
targets: &[Some(wgpu::ColorTargetState {
format: renderer.surface_config().format,
blend: Some(wgpu::BlendState::ALPHA_BLENDING),
@ -53,5 +53,6 @@ pub fn init_smoverlay_pipeline(
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
})
}

View file

@ -34,7 +34,7 @@ pub fn init_world_pipeline(
layout: Some(&world_pipeline_layout),
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
entry_point: Some("fs_main"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: ren.surface_config().format,
@ -44,7 +44,7 @@ pub fn init_world_pipeline(
}),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[
ChunkVertex::LAYOUT,
@ -68,6 +68,7 @@ pub fn init_world_pipeline(
}),
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
});
log::info!("init_world_pipeline: create trans pipeline");
@ -77,7 +78,7 @@ pub fn init_world_pipeline(
layout: Some(&world_pipeline_layout),
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main_trans",
entry_point: Some("fs_main_trans"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: ren.surface_config().format,
@ -87,7 +88,7 @@ pub fn init_world_pipeline(
}),
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
entry_point: Some("vs_main"),
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[
ChunkVertex::LAYOUT,
@ -111,6 +112,7 @@ pub fn init_world_pipeline(
}),
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
});
(pipeline_main, pipeline_trans)

View file

@ -82,7 +82,9 @@ impl ChunkMeshStorage {
pub fn insert(&mut self, mesh: ChunkMesh) -> usize {
let index = self.index;
debug_assert!(self.meshes.get(&index).is_none());
unsafe {
self.meshes.insert_unique_unchecked(index, mesh);
}
self.index += 1;
index
}

View file

@ -82,7 +82,9 @@ pub fn update_chunks_if_player_moved(
Some(chunk) => chunk,
None => {
let chunk = Chunk::new(chunk_pos);
unsafe {
vm_world.chunks.insert_unique_unchecked(chunk_pos, chunk);
}
vm_world.chunks.get_mut(&chunk_pos).unwrap()
}
};

View file

@ -12,7 +12,7 @@ pub struct MeshGenData {
pub block_data_pos_x: BlockData,
pub block_data_neg_x: BlockData,
}
impl<'a> AllChunkNeighbors<'a> {
impl AllChunkNeighbors<'_> {
pub fn mesh_data(&self) -> Option<MeshGenData> {
let center_block_data = self.center.block_data.as_ref()?;
let front_block_data = self.front.block_data.as_ref()?;

View file

@ -116,7 +116,15 @@ impl super::ChunkStorage {
&(coords + ivec3(1, 0, 0)),
&(coords + ivec3(0, 0, 1)),
&(coords - ivec3(0, 0, 1)),
])?;
Some(AllChunkNeighborsMut { center, top, bottom, left, right, front, back })
]);
Some(AllChunkNeighborsMut {
center: center?,
top: top?,
bottom: bottom?,
left: left?,
right: right?,
front: front?,
back: back?,
})
}
}