mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-21 19:38:20 -06:00
Update deps/fix some warnings
This commit is contained in:
parent
0349cd53c1
commit
4d89789781
645
Cargo.lock
generated
645
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
18
flake.lock
18
flake.lock
|
@ -8,11 +8,11 @@
|
||||||
"rust-analyzer-src": "rust-analyzer-src"
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725172314,
|
"lastModified": 1733899011,
|
||||||
"narHash": "sha256-BtLY9lWu/pe6/ImFwuRRRqMwLacY5AZOKA2hUHUQ64k=",
|
"narHash": "sha256-SpHdn/wQ1Y4YfpJ2WJBT+nFFMSDTtbQPtgFidonsiv0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "fenix",
|
"repo": "fenix",
|
||||||
"rev": "28b42d01f549c38bd165296fbcb4fe66d98fc24f",
|
"rev": "24b76cc6d5bebb01947ae7a3e6ac894239abc7be",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,11 +36,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1724819573,
|
"lastModified": 1733759999,
|
||||||
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
|
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
|
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -60,11 +60,11 @@
|
||||||
"rust-analyzer-src": {
|
"rust-analyzer-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725094379,
|
"lastModified": 1733814336,
|
||||||
"narHash": "sha256-TBujPMMIv8RG6BKlsBEpCln1ePmWz79xTcJOQpU2L18=",
|
"narHash": "sha256-xKttEMfuf2hzcdiNQucxkvW2vCUe5e9HyfPntOcBSq0=",
|
||||||
"owner": "rust-lang",
|
"owner": "rust-lang",
|
||||||
"repo": "rust-analyzer",
|
"repo": "rust-analyzer",
|
||||||
"rev": "914a1caab54e48a028b2407d0fe6fade89532f67",
|
"rev": "7b4b83ba916800dfa4b4776790fdf6771c22f82e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{
|
{
|
||||||
self,
|
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
yafas,
|
yafas,
|
||||||
fenix,
|
fenix,
|
||||||
|
|
|
@ -11,8 +11,8 @@ log = "0.4"
|
||||||
shipyard = { version = "0.7", default-features = false, features = ["std", "proc", "thread_local"] }
|
shipyard = { version = "0.7", default-features = false, features = ["std", "proc", "thread_local"] }
|
||||||
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
|
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
glam = { version = "0.28", features = ["debug-glam-assert", "fast-math"] }
|
glam = { version = "0.29", features = ["debug-glam-assert", "fast-math"] }
|
||||||
hashbrown = "0.14"
|
hashbrown = "0.15"
|
||||||
nohash-hasher = "0.2"
|
nohash-hasher = "0.2"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
rayon = "1.10"
|
rayon = "1.10"
|
||||||
|
|
|
@ -10,7 +10,7 @@ pub fn init_save_file(storages: &AllStoragesView) -> Option<IOThreadManager> {
|
||||||
let config = storages.borrow::<UniqueView<ConfigTable>>().unwrap();
|
let config = storages.borrow::<UniqueView<ConfigTable>>().unwrap();
|
||||||
if let Some(file_path) = &config.world.file {
|
if let Some(file_path) = &config.world.file {
|
||||||
log::info!("Initializing save file from {:?}", file_path);
|
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))
|
Some(IOThreadManager::new(save))
|
||||||
} else {
|
} else {
|
||||||
log::warn!("No save file specified, world will not be saved");
|
log::warn!("No save file specified, world will not be saved");
|
||||||
|
@ -31,7 +31,7 @@ pub fn save_modified(
|
||||||
};
|
};
|
||||||
ctm.run(ChunkTask::SaveChunk {
|
ctm.run(ChunkTask::SaveChunk {
|
||||||
position: *position,
|
position: *position,
|
||||||
data: data,
|
data,
|
||||||
});
|
});
|
||||||
chunk.data_modified = false;
|
chunk.data_modified = false;
|
||||||
amount_saved += 1;
|
amount_saved += 1;
|
||||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[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"] }
|
shipyard = { version = "0.7", default-features = false, features = ["std"] }
|
||||||
strum = { version = "0.26", features = ["derive"] }
|
strum = { version = "0.26", features = ["derive"] }
|
||||||
num_enum = "0.7"
|
num_enum = "0.7"
|
||||||
|
@ -18,7 +18,7 @@ flume = "0.11"
|
||||||
fastnoise-lite = { version = "1.1", features = ["std", "f64"] }
|
fastnoise-lite = { version = "1.1", features = ["std", "f64"] }
|
||||||
rand = { version = "0.8", default_features = false, features = ["std", "min_const_gen"] }
|
rand = { version = "0.8", default_features = false, features = ["std", "min_const_gen"] }
|
||||||
rand_xoshiro = "0.6"
|
rand_xoshiro = "0.6"
|
||||||
hashbrown = { version = "0.14", features = ["serde"] }
|
hashbrown = { version = "0.15", features = ["serde"] }
|
||||||
nohash-hasher = "0.2"
|
nohash-hasher = "0.2"
|
||||||
bytemuck = { version = "1.14", features = ["derive"] }
|
bytemuck = { version = "1.14", features = ["derive"] }
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1"
|
||||||
|
|
|
@ -191,6 +191,7 @@ pub fn open_local_save_file(path: &Path) -> Result<WorldSaveFile> {
|
||||||
.read(true)
|
.read(true)
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
|
.truncate(false)
|
||||||
.open(path)?
|
.open(path)?
|
||||||
});
|
});
|
||||||
if save_file.file.metadata().unwrap().len() == 0 {
|
if save_file.file.metadata().unwrap().len() == 0 {
|
||||||
|
|
|
@ -26,7 +26,9 @@ impl FixedTimestamp for Workload {
|
||||||
let duration = Duration::from_millis(rate_millis as u64);
|
let duration = Duration::from_millis(rate_millis as u64);
|
||||||
(self,).into_workload().run_if(move |mut timestamps: UniqueViewMut<FixedTimestampStorage>| {
|
(self,).into_workload().run_if(move |mut timestamps: UniqueViewMut<FixedTimestampStorage>| {
|
||||||
let Some(t) = timestamps.0.get_mut(&key) else {
|
let Some(t) = timestamps.0.get_mut(&key) else {
|
||||||
timestamps.0.insert_unique_unchecked(key, Instant::now());
|
unsafe {
|
||||||
|
timestamps.0.insert_unique_unchecked(key, Instant::now());
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
};
|
};
|
||||||
if t.elapsed() >= duration {
|
if t.elapsed() >= duration {
|
||||||
|
|
|
@ -11,30 +11,30 @@ crate-type = ["lib", "cdylib"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
kubi-shared = { path = "../kubi-shared" }
|
kubi-shared = { path = "../kubi-shared" }
|
||||||
kubi-logging = { path = "../kubi-logging" }
|
kubi-logging = { path = "../kubi-logging" }
|
||||||
hui = { 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 = "121e667bdb" }
|
hui-wgpu = { git = "https://github.com/griffi-gh/hui", rev = "1b5cdb192f39029e23c6fda199ee7982e7c85cbc" }
|
||||||
hui-winit = { git = "https://github.com/griffi-gh/hui", rev = "121e667bdb" }
|
hui-winit = { git = "https://github.com/griffi-gh/hui", rev = "1b5cdb192f39029e23c6fda199ee7982e7c85cbc" }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
wgpu = { version = "0.20", features = ["webgl"] }
|
wgpu = { version = "23", features = ["webgl"] }
|
||||||
pollster = "0.3"
|
pollster = "0.4"
|
||||||
bytemuck = { version = "1.15", features = ["derive"] }
|
bytemuck = { version = "1.15", features = ["derive"] }
|
||||||
winit = { version = "0.30", features = ["android-native-activity"] }
|
winit = { version = "0.30", features = ["android-native-activity"] }
|
||||||
raw-window-handle = "0.6"
|
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"] }
|
image = { version = "0.25", default_features = false, features = ["png"] }
|
||||||
strum = { version = "0.26", features = ["derive"] }
|
strum = { version = "0.26", features = ["derive"] }
|
||||||
hashbrown = "0.14"
|
hashbrown = "0.15"
|
||||||
nohash-hasher = "0.2"
|
nohash-hasher = "0.2"
|
||||||
rayon = "1.10"
|
rayon = "1.10"
|
||||||
shipyard = { version = "0.7", default-features = false, features = ["std", "proc", "thread_local"] }
|
shipyard = { version = "0.7", default-features = false, features = ["std", "proc", "thread_local"] }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
flume = "0.11"
|
flume = "0.11"
|
||||||
gilrs = { version = "0.10", default_features = false, features = ["xinput"] }
|
gilrs = { version = "0.11", default_features = false, features = ["xinput"] }
|
||||||
uflow = "0.7"
|
uflow = "0.7"
|
||||||
postcard = { version = "1.0", features = ["alloc"] }
|
postcard = { version = "1.0", features = ["alloc"] }
|
||||||
lz4_flex = { version = "0.11", default-features = false, features = ["std"] }
|
lz4_flex = { version = "0.11", default-features = false, features = ["std"] }
|
||||||
static_assertions = "1.1"
|
static_assertions = "1.1"
|
||||||
tinyset = "0.4"
|
tinyset = "0.5"
|
||||||
serde_json = { version = "1.0", optional = true } #only used for `generate_visualizer_data`
|
serde_json = { version = "1.0", optional = true } #only used for `generate_visualizer_data`
|
||||||
rand = { version = "0.8", features = ["alloc", "small_rng"]}
|
rand = { version = "0.8", features = ["alloc", "small_rng"]}
|
||||||
atomic = "0.6"
|
atomic = "0.6"
|
||||||
|
|
|
@ -125,6 +125,6 @@ pub fn update_frustum(
|
||||||
transforms: View<Transform, track::All>
|
transforms: View<Transform, track::All>
|
||||||
) {
|
) {
|
||||||
for (camera, _) in (&mut cameras, transforms.inserted_or_modified()).iter() {
|
for (camera, _) in (&mut cameras, transforms.inserted_or_modified()).iter() {
|
||||||
camera.frustum = Frustum::compute(&camera);
|
camera.frustum = Frustum::compute(camera);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ fn process_gilrs_events(
|
||||||
mut active_gamepad: UniqueViewMut<ActiveGamepad>
|
mut active_gamepad: UniqueViewMut<ActiveGamepad>
|
||||||
) {
|
) {
|
||||||
if let Some(gilrs) = &mut gilrs.0 {
|
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);
|
active_gamepad.0 = Some(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#![forbid(
|
#![forbid(
|
||||||
static_mut_refs,
|
static_mut_refs,
|
||||||
unsafe_op_in_unsafe_fn,
|
unsafe_op_in_unsafe_fn,
|
||||||
rust_2024_compatibility,
|
// rust_2024_compatibility,
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use shipyard::{
|
use shipyard::{
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub fn init_entities_pipeline(
|
||||||
vertex: wgpu::VertexState {
|
vertex: wgpu::VertexState {
|
||||||
module: &module,
|
module: &module,
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
entry_point: "vs_main",
|
entry_point: Some("vs_main"),
|
||||||
buffers: &[
|
buffers: &[
|
||||||
ModelVertex::LAYOUT,
|
ModelVertex::LAYOUT,
|
||||||
InstanceData::LAYOUT,
|
InstanceData::LAYOUT,
|
||||||
|
@ -37,7 +37,7 @@ pub fn init_entities_pipeline(
|
||||||
fragment: Some(wgpu::FragmentState {
|
fragment: Some(wgpu::FragmentState {
|
||||||
module: &module,
|
module: &module,
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
entry_point: "fs_main",
|
entry_point: Some("fs_main"),
|
||||||
targets: &[Some(wgpu::ColorTargetState {
|
targets: &[Some(wgpu::ColorTargetState {
|
||||||
format: renderer.surface_config().format,
|
format: renderer.surface_config().format,
|
||||||
blend: Some(wgpu::BlendState::REPLACE),
|
blend: Some(wgpu::BlendState::REPLACE),
|
||||||
|
@ -62,5 +62,6 @@ pub fn init_entities_pipeline(
|
||||||
}),
|
}),
|
||||||
multisample: wgpu::MultisampleState::default(),
|
multisample: wgpu::MultisampleState::default(),
|
||||||
multiview: None,
|
multiview: None,
|
||||||
|
cache: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,7 @@ impl Renderer {
|
||||||
label: None,
|
label: None,
|
||||||
required_features: wgpu::Features::empty(),
|
required_features: wgpu::Features::empty(),
|
||||||
required_limits: wgpu::Limits::downlevel_webgl2_defaults().using_resolution(adapter.limits()),
|
required_limits: wgpu::Limits::downlevel_webgl2_defaults().using_resolution(adapter.limits()),
|
||||||
|
memory_hints: wgpu::MemoryHints::Performance,
|
||||||
},
|
},
|
||||||
None,
|
None,
|
||||||
).block_on().unwrap();
|
).block_on().unwrap();
|
||||||
|
|
|
@ -32,7 +32,7 @@ pub fn init_selection_box_pipeline(
|
||||||
layout: Some(&selection_box_pipeline_layout),
|
layout: Some(&selection_box_pipeline_layout),
|
||||||
fragment: Some(wgpu::FragmentState {
|
fragment: Some(wgpu::FragmentState {
|
||||||
module: &shader,
|
module: &shader,
|
||||||
entry_point: "fs_main",
|
entry_point: Some("fs_main"),
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
targets: &[Some(wgpu::ColorTargetState {
|
targets: &[Some(wgpu::ColorTargetState {
|
||||||
format: ren.surface_config().format,
|
format: ren.surface_config().format,
|
||||||
|
@ -42,7 +42,7 @@ pub fn init_selection_box_pipeline(
|
||||||
}),
|
}),
|
||||||
vertex: wgpu::VertexState {
|
vertex: wgpu::VertexState {
|
||||||
module: &shader,
|
module: &shader,
|
||||||
entry_point: "vs_main",
|
entry_point: Some("vs_main"),
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
buffers: &[
|
buffers: &[
|
||||||
PrimitiveVertex::LAYOUT,
|
PrimitiveVertex::LAYOUT,
|
||||||
|
@ -66,5 +66,6 @@ pub fn init_selection_box_pipeline(
|
||||||
}),
|
}),
|
||||||
multisample: wgpu::MultisampleState::default(),
|
multisample: wgpu::MultisampleState::default(),
|
||||||
multiview: None,
|
multiview: None,
|
||||||
|
cache: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub fn init_smoverlay_pipeline(
|
||||||
vertex: wgpu::VertexState {
|
vertex: wgpu::VertexState {
|
||||||
module: &module,
|
module: &module,
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
entry_point: "vs_main",
|
entry_point: Some("vs_main"),
|
||||||
buffers: &[
|
buffers: &[
|
||||||
PrimitiveVertex2::LAYOUT,
|
PrimitiveVertex2::LAYOUT,
|
||||||
],
|
],
|
||||||
|
@ -34,7 +34,7 @@ pub fn init_smoverlay_pipeline(
|
||||||
fragment: Some(wgpu::FragmentState {
|
fragment: Some(wgpu::FragmentState {
|
||||||
module: &module,
|
module: &module,
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
entry_point: "fs_main",
|
entry_point: Some("fs_main"),
|
||||||
targets: &[Some(wgpu::ColorTargetState {
|
targets: &[Some(wgpu::ColorTargetState {
|
||||||
format: renderer.surface_config().format,
|
format: renderer.surface_config().format,
|
||||||
blend: Some(wgpu::BlendState::ALPHA_BLENDING),
|
blend: Some(wgpu::BlendState::ALPHA_BLENDING),
|
||||||
|
@ -53,5 +53,6 @@ pub fn init_smoverlay_pipeline(
|
||||||
depth_stencil: None,
|
depth_stencil: None,
|
||||||
multisample: wgpu::MultisampleState::default(),
|
multisample: wgpu::MultisampleState::default(),
|
||||||
multiview: None,
|
multiview: None,
|
||||||
|
cache: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ pub fn init_world_pipeline(
|
||||||
layout: Some(&world_pipeline_layout),
|
layout: Some(&world_pipeline_layout),
|
||||||
fragment: Some(wgpu::FragmentState {
|
fragment: Some(wgpu::FragmentState {
|
||||||
module: &shader,
|
module: &shader,
|
||||||
entry_point: "fs_main",
|
entry_point: Some("fs_main"),
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
targets: &[Some(wgpu::ColorTargetState {
|
targets: &[Some(wgpu::ColorTargetState {
|
||||||
format: ren.surface_config().format,
|
format: ren.surface_config().format,
|
||||||
|
@ -44,7 +44,7 @@ pub fn init_world_pipeline(
|
||||||
}),
|
}),
|
||||||
vertex: wgpu::VertexState {
|
vertex: wgpu::VertexState {
|
||||||
module: &shader,
|
module: &shader,
|
||||||
entry_point: "vs_main",
|
entry_point: Some("vs_main"),
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
buffers: &[
|
buffers: &[
|
||||||
ChunkVertex::LAYOUT,
|
ChunkVertex::LAYOUT,
|
||||||
|
@ -68,6 +68,7 @@ pub fn init_world_pipeline(
|
||||||
}),
|
}),
|
||||||
multisample: wgpu::MultisampleState::default(),
|
multisample: wgpu::MultisampleState::default(),
|
||||||
multiview: None,
|
multiview: None,
|
||||||
|
cache: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
log::info!("init_world_pipeline: create trans pipeline");
|
log::info!("init_world_pipeline: create trans pipeline");
|
||||||
|
@ -77,7 +78,7 @@ pub fn init_world_pipeline(
|
||||||
layout: Some(&world_pipeline_layout),
|
layout: Some(&world_pipeline_layout),
|
||||||
fragment: Some(wgpu::FragmentState {
|
fragment: Some(wgpu::FragmentState {
|
||||||
module: &shader,
|
module: &shader,
|
||||||
entry_point: "fs_main_trans",
|
entry_point: Some("fs_main_trans"),
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
targets: &[Some(wgpu::ColorTargetState {
|
targets: &[Some(wgpu::ColorTargetState {
|
||||||
format: ren.surface_config().format,
|
format: ren.surface_config().format,
|
||||||
|
@ -87,7 +88,7 @@ pub fn init_world_pipeline(
|
||||||
}),
|
}),
|
||||||
vertex: wgpu::VertexState {
|
vertex: wgpu::VertexState {
|
||||||
module: &shader,
|
module: &shader,
|
||||||
entry_point: "vs_main",
|
entry_point: Some("vs_main"),
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
buffers: &[
|
buffers: &[
|
||||||
ChunkVertex::LAYOUT,
|
ChunkVertex::LAYOUT,
|
||||||
|
@ -111,6 +112,7 @@ pub fn init_world_pipeline(
|
||||||
}),
|
}),
|
||||||
multisample: wgpu::MultisampleState::default(),
|
multisample: wgpu::MultisampleState::default(),
|
||||||
multiview: None,
|
multiview: None,
|
||||||
|
cache: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
(pipeline_main, pipeline_trans)
|
(pipeline_main, pipeline_trans)
|
||||||
|
|
|
@ -82,7 +82,9 @@ impl ChunkMeshStorage {
|
||||||
pub fn insert(&mut self, mesh: ChunkMesh) -> usize {
|
pub fn insert(&mut self, mesh: ChunkMesh) -> usize {
|
||||||
let index = self.index;
|
let index = self.index;
|
||||||
debug_assert!(self.meshes.get(&index).is_none());
|
debug_assert!(self.meshes.get(&index).is_none());
|
||||||
self.meshes.insert_unique_unchecked(index, mesh);
|
unsafe {
|
||||||
|
self.meshes.insert_unique_unchecked(index, mesh);
|
||||||
|
}
|
||||||
self.index += 1;
|
self.index += 1;
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,9 @@ pub fn update_chunks_if_player_moved(
|
||||||
Some(chunk) => chunk,
|
Some(chunk) => chunk,
|
||||||
None => {
|
None => {
|
||||||
let chunk = Chunk::new(chunk_pos);
|
let chunk = Chunk::new(chunk_pos);
|
||||||
vm_world.chunks.insert_unique_unchecked(chunk_pos, chunk);
|
unsafe {
|
||||||
|
vm_world.chunks.insert_unique_unchecked(chunk_pos, chunk);
|
||||||
|
}
|
||||||
vm_world.chunks.get_mut(&chunk_pos).unwrap()
|
vm_world.chunks.get_mut(&chunk_pos).unwrap()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub struct MeshGenData {
|
||||||
pub block_data_pos_x: BlockData,
|
pub block_data_pos_x: BlockData,
|
||||||
pub block_data_neg_x: BlockData,
|
pub block_data_neg_x: BlockData,
|
||||||
}
|
}
|
||||||
impl<'a> AllChunkNeighbors<'a> {
|
impl AllChunkNeighbors<'_> {
|
||||||
pub fn mesh_data(&self) -> Option<MeshGenData> {
|
pub fn mesh_data(&self) -> Option<MeshGenData> {
|
||||||
let center_block_data = self.center.block_data.as_ref()?;
|
let center_block_data = self.center.block_data.as_ref()?;
|
||||||
let front_block_data = self.front.block_data.as_ref()?;
|
let front_block_data = self.front.block_data.as_ref()?;
|
||||||
|
|
|
@ -116,7 +116,15 @@ impl super::ChunkStorage {
|
||||||
&(coords + ivec3(1, 0, 0)),
|
&(coords + ivec3(1, 0, 0)),
|
||||||
&(coords + ivec3(0, 0, 1)),
|
&(coords + ivec3(0, 0, 1)),
|
||||||
&(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?,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue