Skip to content

Commit

Permalink
Update to wgpu 0.20 and egui 0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Jul 19, 2024
1 parent 0aac343 commit bb3dc3b
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 16 deletions.
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ wgpu_serde = ["wgpu/serde"]
indexmap = "2.2"
pollster = "0.3"
image = "0.25"
bytemuck = { version = "1.15", features = ["derive"] }
wgpu = { version = "0.19", default_features = true, features = ["naga-ir"] }
winit = { version = "0.29", features = ["rwh_05"] }
bytemuck = { version = "1.16", features = ["derive"] }
wgpu = { version = "0.20", default-features = true, features = ["naga-ir"] }
winit = { version = "0.29", features = [] }
glam = "0.27"
path-clean = "1.0.1"
notify = "6.1"
flume = "0.11"
log = "0.4"

# Optional Egui
egui = { version = "0.27", optional = true }
egui-wgpu = { version = "0.27", optional = true }
egui-winit = { version = "0.27", optional = true }
egui_extras = { version = "0.27", optional = true }
egui_demo_lib = { version = "0.27", optional = true }
egui_plot = { version = "0.27", optional = true }
egui = { version = "0.28", optional = true }
egui-wgpu = { version = "0.28", optional = true }
egui-winit = { version = "0.28", optional = true }
egui_extras = { version = "0.28", optional = true }
egui_demo_lib = { version = "0.28", optional = true }
egui_plot = { version = "0.28", optional = true }

[dev-dependencies]
egui_demo_lib = { version = "0.27" }
winit_input_helper = "0.15"
rapier2d = { version = "0.19", features = ["default", "debug-render"] }
egui_demo_lib = { version = "0.28" }
winit_input_helper = "0.16"
rapier2d = { version = "0.21.0", features = ["default", "debug-render"] }
rand = "0.8"

[lints.clippy]
Expand Down
8 changes: 4 additions & 4 deletions examples/fluid_sim/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use glass::{
GlassApp, GlassContext, RenderData,
};
use wgpu::{CommandBuffer, StoreOp};
use winit::keyboard::KeyCode;
use winit::{event::MouseButton, keyboard::KeyCode};
use winit_input_helper::WinitInputHelper;

use crate::{
Expand Down Expand Up @@ -123,13 +123,13 @@ impl GlassApp for FluidSimApp {
],
&self.camera,
);
if self.input.mouse_pressed(0) {
if self.input.mouse_pressed(MouseButton::Left) {
self.fluid_scene.drag(pos, true);
}
if self.input.mouse_held(0) {
if self.input.mouse_held(MouseButton::Left) {
self.fluid_scene.drag(pos, false);
}
if self.input.mouse_released(0) {
if self.input.mouse_released(MouseButton::Left) {
self.fluid_scene.end_drag();
}
}
Expand Down
2 changes: 2 additions & 0 deletions examples/fluid_sim/circle_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ impl CirclePipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[SimpleVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
compilation_options: Default::default(),
targets: &[Some(color_target_state)],
}),
primitive: wgpu::PrimitiveState {
Expand Down
2 changes: 2 additions & 0 deletions examples/fluid_sim/rectangle_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ impl RectanglePipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[SimpleVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
compilation_options: Default::default(),
targets: &[Some(color_target_state)],
}),
primitive: wgpu::PrimitiveState {
Expand Down
3 changes: 3 additions & 0 deletions examples/game_of_life/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ fn create_game_of_life_pipeline(
layout: Some(&game_of_life_init_layout),
module: &game_of_life_shader,
entry_point: "init",
compilation_options: Default::default(),
});

let game_of_life_layout =
Expand All @@ -582,6 +583,7 @@ fn create_game_of_life_pipeline(
layout: Some(&game_of_life_layout),
module: &game_of_life_shader,
entry_point: "update",
compilation_options: Default::default(),
});

let draw_layout = context
Expand All @@ -601,6 +603,7 @@ fn create_game_of_life_pipeline(
layout: Some(&draw_layout),
module: &brush_shader,
entry_point: "main",
compilation_options: Default::default(),
});

(init_pipeline, update_pipeline, draw_pipeline)
Expand Down
2 changes: 2 additions & 0 deletions examples/shader_with_includes/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ fn create_triangle_pipeline(context: &GlassContext) -> RenderPipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
compilation_options: Default::default(),
targets: &[Some(TextureFormat::Bgra8UnormSrgb.into())],
}),
primitive: PrimitiveState::default(),
Expand Down
8 changes: 8 additions & 0 deletions src/pipelines/bloom/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ impl BloomPipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[SimpleTexturedVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "downsample_first",
compilation_options: Default::default(),
targets: &[Some(ColorTargetState {
format: BLOOM_TEXTURE_FORMAT,
blend: None,
Expand All @@ -147,11 +149,13 @@ impl BloomPipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[SimpleTexturedVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "downsample",
compilation_options: Default::default(),
targets: &[Some(ColorTargetState {
format: BLOOM_TEXTURE_FORMAT,
blend: None,
Expand Down Expand Up @@ -183,11 +187,13 @@ impl BloomPipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[SimpleTexturedVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "upsample",
compilation_options: Default::default(),
targets: &[Some(ColorTargetState {
format: BLOOM_TEXTURE_FORMAT,
blend: Some(BlendState {
Expand All @@ -213,11 +219,13 @@ impl BloomPipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[SimpleTexturedVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "upsample",
compilation_options: Default::default(),
targets: &[Some(ColorTargetState {
format: FINAL_TEXTURE_FORMAT,
blend: Some(BlendState {
Expand Down
2 changes: 2 additions & 0 deletions src/pipelines/line/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ impl LinePipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[ColoredVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
compilation_options: Default::default(),
targets: &[Some(color_target_state)],
}),
primitive: wgpu::PrimitiveState {
Expand Down
2 changes: 2 additions & 0 deletions src/pipelines/paste/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ impl PastePipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[TexturedVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fragment",
compilation_options: Default::default(),
targets: &[Some(ColorTargetState {
format: target_texture_format,
blend: Some(wgpu::BlendState {
Expand Down
2 changes: 2 additions & 0 deletions src/pipelines/quad/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ impl QuadPipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[TexturedVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
compilation_options: Default::default(),
targets: &[Some(color_target_state)],
}),
primitive: wgpu::PrimitiveState {
Expand Down
2 changes: 2 additions & 0 deletions src/pipelines/tonemapping/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ impl TonemappingPipeline {
vertex: wgpu::VertexState {
module: &shader,
entry_point: "vs_main",
compilation_options: Default::default(),
buffers: &[SimpleTexturedVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fragment",
compilation_options: Default::default(),
targets: &[Some(ColorTargetState {
format: TONEMAPPING_TEXTURE_FORMAT,
blend: None,
Expand Down

0 comments on commit bb3dc3b

Please sign in to comment.