Skip to content

Commit

Permalink
update deps and rust warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Jun 30, 2024
1 parent eae0275 commit 1a568fd
Show file tree
Hide file tree
Showing 44 changed files with 883 additions and 889 deletions.
1,249 changes: 567 additions & 682 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions egui-inspect/src/impls/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ impl Inspect<f32> for f32 {
ui.label(label);
ui.add(
egui::DragValue::new(data)
.clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX))
.speed(args.step.unwrap_or(0.1)),
);
});
Expand Down
8 changes: 2 additions & 6 deletions egui-inspect/src/impls/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ impl Inspect<f64> for f64 {
ui.label(label);
ui.add(
egui::DragValue::new(data)
.clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX))
.speed(args.step.unwrap_or(1.0)),
);
});
Expand Down Expand Up @@ -54,9 +52,7 @@ impl Inspect<f64> for InspectF64Deg {
ui.label(label);
ui.add(
egui::DragValue::new(data)
.clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX))
.speed(args.step.unwrap_or(0.25))
.suffix("°"),
);
Expand Down
7 changes: 4 additions & 3 deletions egui-inspect/src/impls/i32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ impl Inspect<i32> for i32 {
let before = *data;
ui.horizontal(|ui| {
ui.label(label);
ui.add(egui::DragValue::new(data).clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
));
ui.add(
egui::DragValue::new(data)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX)),
);
});
before != *data
}
Expand Down
7 changes: 4 additions & 3 deletions egui-inspect/src/impls/i64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ impl Inspect<i64> for i64 {
let before = *data;
ui.horizontal(|ui| {
ui.label(label);
ui.add(egui::DragValue::new(data).clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
));
ui.add(
egui::DragValue::new(data)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX)),
);
});
before != *data
}
Expand Down
7 changes: 4 additions & 3 deletions egui-inspect/src/impls/u16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ impl Inspect<u16> for u16 {
let before = *data;
ui.horizontal(|ui| {
ui.label(label);
ui.add(egui::DragValue::new(data).clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
));
ui.add(
egui::DragValue::new(data)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX)),
);
});
before != *data
}
Expand Down
7 changes: 4 additions & 3 deletions egui-inspect/src/impls/u32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ impl Inspect<u32> for u32 {
let before = *data;
ui.horizontal(|ui| {
ui.label(label);
ui.add(egui::DragValue::new(data).clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
));
ui.add(
egui::DragValue::new(data)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX)),
);
});
before != *data
}
Expand Down
7 changes: 4 additions & 3 deletions egui-inspect/src/impls/u64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ impl Inspect<u64> for u64 {
let before = *data;
ui.horizontal(|ui| {
ui.label(label);
ui.add(egui::DragValue::new(data).clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
));
ui.add(
egui::DragValue::new(data)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX)),
);
});
before != *data
}
Expand Down
7 changes: 4 additions & 3 deletions egui-inspect/src/impls/u8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ impl Inspect<u8> for u8 {
let before = *data;
ui.horizontal(|ui| {
ui.label(label);
ui.add(egui::DragValue::new(data).clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
));
ui.add(
egui::DragValue::new(data)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX)),
);
});
before != *data
}
Expand Down
7 changes: 4 additions & 3 deletions egui-inspect/src/impls/usize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ impl Inspect<usize> for usize {
let before = *data;
ui.horizontal(|ui| {
ui.label(label);
ui.add(egui::DragValue::new(data).clamp_range(
args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX),
));
ui.add(
egui::DragValue::new(data)
.range(args.min_value.unwrap_or(f32::MIN)..=args.max_value.unwrap_or(f32::MAX)),
);
});
before != *data
}
Expand Down
4 changes: 2 additions & 2 deletions engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ ordered-float = { workspace = true }
egui = { workspace = true }
oddio = { workspace = true }
derive_more = { workspace = true }
wgpu = { version = "0.19.0", default-features = false, features=["wgsl"] }
wgpu = { version = "0.20.1", default-features = false, features=["wgsl"] }
winit = { version = "0.29.4" }
smol_str = { version = "0.2.0", features = ["serde"] }
egui-winit = { git = "https://github.com/emilk/egui" , default-features = false }
bytemuck = "1.7.2"
image = { version = "0.24.3", default-features = false, features = ["png"] }
image = { version = "0.25.1", default-features = false, features = ["png"] }
log = "0.4.11"
gltf = { version = "1.2.0", default-features=false, features=["import", "utils", "names", "extensions", "extras"] }
itertools = { version = "0.12.0", default-features = false }
Expand Down
4 changes: 4 additions & 0 deletions engine/src/drawables/heightmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,13 @@ fn normal_pipeline(gfx: &GfxContext, normals_tex: &Texture) -> RenderPipeline {
vertex: wgpu::VertexState {
module: &normal_module,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &normal_module,
entry_point: "calc_normals",
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: normals_tex.format,
blend: None,
Expand Down Expand Up @@ -476,11 +478,13 @@ fn resample_pipeline(gfx: &GfxContext, height_tex: &Texture, entry_point: &str)
vertex: wgpu::VertexState {
module: &resample_module,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &resample_module,
entry_point,
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: height_tex.format,
blend: None,
Expand Down
7 changes: 3 additions & 4 deletions engine/src/egui.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use crate::{GfxContext, GuiRenderContext};
use egui::TextureId;
use egui_wgpu::renderer;
use egui_wgpu::renderer::ScreenDescriptor;
use egui_wgpu::{Renderer, ScreenDescriptor};
use winit::event_loop::EventLoopWindowTarget;
use winit::window::Window;

/// EguiWrapper is a wrapper around egui and egui_wgpu
/// It handles the rendering of the UI
pub struct EguiWrapper {
pub renderer: renderer::Renderer,
pub renderer: Renderer,
pub platform: egui_winit::State,
pub last_mouse_captured: bool,
pub last_kb_captured: bool,
Expand All @@ -23,7 +22,7 @@ impl EguiWrapper {
let viewport_id = egui.viewport_id();
let platform = egui_winit::State::new(egui, viewport_id, el, Some(gfx.size.2 as f32), None);

let renderer = renderer::Renderer::new(&gfx.device, gfx.fbos.format, None, 1);
let renderer = Renderer::new(&gfx.device, gfx.fbos.format, None, 1);

Self {
renderer,
Expand Down
2 changes: 2 additions & 0 deletions engine/src/gfx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,11 +1096,13 @@ impl GfxContext {
vertex: VertexState {
module: vert_shader,
entry_point: "vert",
compilation_options: Default::default(),
buffers: vertex_buffers,
},
fragment: frag_shader.map(|frag_shader| FragmentState {
module: frag_shader,
entry_point: "frag",
compilation_options: Default::default(),
targets: &[],
}),
primitive: PrimitiveState {
Expand Down
1 change: 1 addition & 0 deletions engine/src/lamplights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ impl LampLights {
layout: Some(&texture_write_layout),
module: &texture_write_module,
entry_point: "main",
compilation_options: Default::default(),
});

let texture_write_bg = device.create_bind_group(&wgpu::BindGroupDescriptor {
Expand Down
2 changes: 2 additions & 0 deletions engine/src/passes/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ impl PipelineKey for BackgroundPipeline {
vertex: VertexState {
module: bg,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[UvVertex::desc()],
},
fragment: Some(FragmentState {
module: bg,
entry_point: "frag",
compilation_options: Default::default(),
targets: &color_states,
}),
primitive: PrimitiveState::default(),
Expand Down
2 changes: 2 additions & 0 deletions engine/src/passes/blur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl PipelineKey for UIBlurPipeline {
vertex: VertexState {
module: bg,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(FragmentState {
Expand All @@ -179,6 +180,7 @@ impl PipelineKey for UIBlurPipeline {
UIBlurPipeline::Upscale => "upscale",
UIBlurPipeline::UpscaleDeband => "upscale_deband",
},
compilation_options: Default::default(),
targets: &color_states,
}),
primitive: PrimitiveState::default(),
Expand Down
2 changes: 2 additions & 0 deletions engine/src/passes/fog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ impl PipelineKey for FogPipeline {
vertex: VertexState {
module: &fog,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[UvVertex::desc()],
},
fragment: Some(FragmentState {
module: &fog,
entry_point: "frag",
compilation_options: Default::default(),
targets: &color_states,
}),
primitive: Default::default(),
Expand Down
8 changes: 8 additions & 0 deletions engine/src/passes/pbr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ impl Pbr {
vertex: VertexState {
module: &brdf_convolution_module,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
primitive: PrimitiveState {
Expand All @@ -284,6 +285,7 @@ impl Pbr {
fragment: Some(FragmentState {
module: &brdf_convolution_module,
entry_point: "frag",
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: TextureFormat::Rg16Float,
blend: None,
Expand Down Expand Up @@ -343,6 +345,7 @@ impl PipelineKey for PbrPipeline {
vertex: VertexState {
module: cubemap_vert,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
primitive: Default::default(),
Expand All @@ -351,6 +354,7 @@ impl PipelineKey for PbrPipeline {
fragment: Some(FragmentState {
module: cubemap_frag,
entry_point: "frag",
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: TextureFormat::Rgba16Float,
blend: None,
Expand Down Expand Up @@ -381,6 +385,7 @@ impl PipelineKey for PbrPipeline {
vertex: VertexState {
module: cubemap_vert,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
primitive: Default::default(),
Expand All @@ -389,6 +394,7 @@ impl PipelineKey for PbrPipeline {
fragment: Some(FragmentState {
module: cubemap_frag,
entry_point: "frag",
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: TextureFormat::Rgba16Float,
blend: Some(BlendState::ALPHA_BLENDING),
Expand Down Expand Up @@ -419,6 +425,7 @@ impl PipelineKey for PbrPipeline {
vertex: VertexState {
module: cubemap_vert,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
primitive: Default::default(),
Expand All @@ -427,6 +434,7 @@ impl PipelineKey for PbrPipeline {
fragment: Some(FragmentState {
module: cubemap_frag,
entry_point: "frag",
compilation_options: Default::default(),
targets: &[Some(wgpu::ColorTargetState {
format: TextureFormat::Rgba16Float,
blend: Some(BlendState::ALPHA_BLENDING),
Expand Down
2 changes: 2 additions & 0 deletions engine/src/passes/ssao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ impl PipelineKey for SSAOPipeline {
vertex: VertexState {
module: &ssao,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[UvVertex::desc()],
},
fragment: Some(FragmentState {
module: &ssao,
entry_point: "frag",
compilation_options: Default::default(),
targets: &color_states,
}),
primitive: Default::default(),
Expand Down
2 changes: 2 additions & 0 deletions engine/src/pipeline_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ impl<'a> PipelineBuilder<'a> {
vertex: VertexState {
module: vert_shader,
entry_point: "vert",
compilation_options: Default::default(),
buffers: vertex_buffers,
},
fragment: None,
Expand Down Expand Up @@ -103,6 +104,7 @@ impl<'a> PipelineBuilder<'a> {
fragment: Some(FragmentState {
module: self.frag_shader,
entry_point: "frag",
compilation_options: Default::default(),
targets: &color_states,
}),
primitive: self.descr.primitive,
Expand Down
2 changes: 2 additions & 0 deletions engine/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,11 +812,13 @@ impl MipmapGenerator {
vertex: wgpu::VertexState {
module: &self.module,
entry_point: "vert",
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &self.module,
entry_point: "frag",
compilation_options: Default::default(),
targets: &[Some(format.into())],
}),
primitive: wgpu::PrimitiveState::default(),
Expand Down
4 changes: 2 additions & 2 deletions goryak/src/combo_box.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{background, button_secondary};
use yakui_core::geometry::{Constraints, Dim2, Vec2};
use yakui_core::{Alignment, CrossAxisAlignment, MainAxisAlignment, MainAxisSize};
use yakui_core::{Alignment, CrossAxisAlignment, MainAxisAlignment, MainAxisSize, Pivot};
use yakui_widgets::widgets::{Layer, List, Pad};
use yakui_widgets::{colored_box_container, constrained, pad, reflow, use_state};

Expand All @@ -25,7 +25,7 @@ pub fn combo_box(selected: &mut usize, items: &[&str], w: f32) -> bool {

if open.get() {
Layer::new().show(|| {
reflow(Alignment::BOTTOM_LEFT, Dim2::ZERO, || {
reflow(Alignment::BOTTOM_LEFT, Pivot::TOP_LEFT, Dim2::ZERO, || {
constrained(Constraints::loose(Vec2::new(w, f32::INFINITY)), || {
colored_box_container(background(), || {
Pad::all(3.0).show(|| {
Expand Down
Loading

0 comments on commit 1a568fd

Please sign in to comment.