Skip to content

Commit

Permalink
Merge pull request #2510 from iced-rs/wgpu-22.0
Browse files Browse the repository at this point in the history
Update `wgpu` to `22.0`
  • Loading branch information
hecrj authored Sep 19, 2024
2 parents fed9c8d + 84b658d commit b78b8bc
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ advanced = ["iced_core/advanced", "iced_widget/advanced"]
fira-sans = ["iced_renderer/fira-sans"]
# Enables auto-detecting light/dark mode for the built-in theme
auto-detect-theme = ["iced_core/auto-detect-theme"]
# Enables strict assertions for debugging purposes at the expense of performance
strict-assertions = ["iced_renderer/strict-assertions"]

[dependencies]
iced_core.workspace = true
Expand Down Expand Up @@ -148,7 +150,7 @@ cosmic-text = "0.12"
dark-light = "1.0"
futures = "0.3"
glam = "0.25"
glyphon = { git = "https://github.com/hecrj/glyphon.git", rev = "feef9f5630c2adb3528937e55f7bfad2da561a65" }
glyphon = { git = "https://github.com/hecrj/glyphon.git", rev = "0d7ba1bba4dd71eb88d2cface5ce649db2413cb7" }
guillotiere = "0.6"
half = "2.2"
image = { version = "0.24", default-features = false }
Expand Down Expand Up @@ -181,7 +183,7 @@ wasm-bindgen-futures = "0.4"
wasm-timer = "0.2"
web-sys = "0.3.69"
web-time = "1.1"
wgpu = "0.19"
wgpu = "22.0"
winapi = "0.3"
window_clipboard = "0.4.1"
winit = { git = "https://github.com/iced-rs/winit.git", rev = "254d6b3420ce4e674f516f7a2bd440665e05484d" }
Expand Down
1 change: 1 addition & 0 deletions benches/wgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ fn benchmark<'a>(
label: None,
required_features: wgpu::Features::empty(),
required_limits: wgpu::Limits::default(),
memory_hints: wgpu::MemoryHints::MemoryUsage,
},
None,
))
Expand Down
10 changes: 10 additions & 0 deletions examples/custom_shader/src/scene/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ impl Pipeline {
module: &shader,
entry_point: "vs_main",
buffers: &[Vertex::desc(), cube::Raw::desc()],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
primitive: wgpu::PrimitiveState::default(),
depth_stencil: Some(wgpu::DepthStencilState {
Expand Down Expand Up @@ -276,8 +278,11 @@ impl Pipeline {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
cache: None,
});

let depth_pipeline = DepthPipeline::new(
Expand Down Expand Up @@ -490,6 +495,8 @@ impl DepthPipeline {
module: &shader,
entry_point: "vs_main",
buffers: &[],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
primitive: wgpu::PrimitiveState::default(),
depth_stencil: Some(wgpu::DepthStencilState {
Expand All @@ -508,8 +515,11 @@ impl DepthPipeline {
blend: Some(wgpu::BlendState::REPLACE),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
cache: None,
});

Self {
Expand Down
2 changes: 2 additions & 0 deletions examples/integration/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
required_features: adapter_features
& wgpu::Features::default(),
required_limits: wgpu::Limits::default(),
memory_hints:
wgpu::MemoryHints::MemoryUsage,
},
None,
)
Expand Down
3 changes: 3 additions & 0 deletions examples/integration/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ fn build_pipeline(
module: &vs_module,
entry_point: "main",
buffers: &[],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &fs_module,
Expand All @@ -86,6 +87,7 @@ fn build_pipeline(
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -99,5 +101,6 @@ fn build_pipeline(
alpha_to_coverage_enabled: false,
},
multiview: None,
cache: None,
})
}
1 change: 1 addition & 0 deletions renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ geometry = ["iced_graphics/geometry", "iced_tiny_skia?/geometry", "iced_wgpu?/ge
web-colors = ["iced_wgpu?/web-colors"]
webgl = ["iced_wgpu?/webgl"]
fira-sans = ["iced_graphics/fira-sans"]
strict-assertions = ["iced_wgpu?/strict-assertions"]

[dependencies]
iced_graphics.workspace = true
Expand Down
1 change: 1 addition & 0 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ image = ["iced_graphics/image"]
svg = ["iced_graphics/svg", "resvg/text"]
web-colors = ["iced_graphics/web-colors"]
webgl = ["wgpu/webgl"]
strict-assertions = []

[dependencies]
iced_graphics.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions wgpu/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub fn convert(
module: &shader,
entry_point: "vs_main",
buffers: &[],
compilation_options: wgpu::PipelineCompilationOptions::default(
),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -130,6 +132,8 @@ pub fn convert(
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: wgpu::PipelineCompilationOptions::default(
),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -139,6 +143,7 @@ pub fn convert(
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
});

let texture = device.create_texture(&wgpu::TextureDescriptor {
Expand Down
5 changes: 5 additions & 0 deletions wgpu/src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ impl Pipeline {
8 => Uint32,
),
}],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -173,6 +175,8 @@ impl Pipeline {
}),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -186,6 +190,7 @@ impl Pipeline {
alpha_to_coverage_enabled: false,
},
multiview: None,
cache: None,
});

Pipeline {
Expand Down
5 changes: 5 additions & 0 deletions wgpu/src/quad/gradient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,15 @@ impl Pipeline {
9 => Float32
),
}],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "gradient_fs_main",
targets: &quad::color_target_state(format),
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -170,6 +174,7 @@ impl Pipeline {
alpha_to_coverage_enabled: false,
},
multiview: None,
cache: None,
},
);

Expand Down
5 changes: 5 additions & 0 deletions wgpu/src/quad/solid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,15 @@ impl Pipeline {
8 => Float32,
),
}],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "solid_fs_main",
targets: &quad::color_target_state(format),
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -132,6 +136,7 @@ impl Pipeline {
alpha_to_coverage_enabled: false,
},
multiview: None,
cache: None,
});

Self { pipeline }
Expand Down
10 changes: 10 additions & 0 deletions wgpu/src/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,21 @@ mod solid {
1 => Float32x4,
),
}],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "solid_fs_main",
targets: &[Some(triangle::fragment_target(format))],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
primitive: triangle::primitive_state(),
depth_stencil: None,
multisample: triangle::multisample_state(antialiasing),
multiview: None,
cache: None,
},
);

Expand Down Expand Up @@ -937,16 +942,21 @@ mod gradient {
6 => Float32x4
),
}],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "gradient_fs_main",
targets: &[Some(triangle::fragment_target(format))],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
primitive: triangle::primitive_state(),
depth_stencil: None,
multisample: triangle::multisample_state(antialiasing),
multiview: None,
cache: None,
},
);

Expand Down
5 changes: 5 additions & 0 deletions wgpu/src/triangle/msaa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ impl Blit {
module: &shader,
entry_point: "vs_main",
buffers: &[],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader,
Expand All @@ -123,6 +125,8 @@ impl Blit {
),
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
Expand All @@ -136,6 +140,7 @@ impl Blit {
alpha_to_coverage_enabled: false,
},
multiview: None,
cache: None,
});

Blit {
Expand Down
6 changes: 6 additions & 0 deletions wgpu/src/window/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ impl Compositor {
) -> Result<Self, Error> {
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: settings.backends,
flags: if cfg!(feature = "strict-assertions") {
wgpu::InstanceFlags::debugging()
} else {
wgpu::InstanceFlags::empty()
},
..Default::default()
});

Expand Down Expand Up @@ -162,6 +167,7 @@ impl Compositor {
),
required_features: wgpu::Features::empty(),
required_limits: required_limits.clone(),
memory_hints: wgpu::MemoryHints::MemoryUsage,
},
None,
)
Expand Down

0 comments on commit b78b8bc

Please sign in to comment.