Merge branch 'master' into advanced-text
This commit is contained in:
commit
4bae457c37
73 changed files with 1586 additions and 703 deletions
|
|
@ -205,7 +205,7 @@ impl Pipeline {
|
|||
|
||||
let shader =
|
||||
device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: Some("iced_wgpu::image::shader"),
|
||||
label: Some("iced_wgpu image shader"),
|
||||
source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(
|
||||
include_str!("shader/image.wgsl"),
|
||||
)),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
//! - Meshes of triangles, useful to draw geometry freely.
|
||||
//!
|
||||
//! [Iced]: https://github.com/iced-rs/iced
|
||||
//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.8/native
|
||||
//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.9/native
|
||||
//! [`wgpu`]: https://github.com/gfx-rs/wgpu-rs
|
||||
//! [WebGPU API]: https://gpuweb.github.io/gpuweb/
|
||||
//! [`wgpu_glyph`]: https://github.com/hecrj/wgpu_glyph
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ impl Pipeline {
|
|||
|
||||
let shader =
|
||||
device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: Some("iced_wgpu::quad::shader"),
|
||||
label: Some("iced_wgpu quad shader"),
|
||||
source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(
|
||||
include_str!("shader/quad.wgsl"),
|
||||
)),
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ mod solid {
|
|||
let shader =
|
||||
device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: Some(
|
||||
"iced_wgpu::triangle::solid create shader module",
|
||||
"iced_wgpu triangle solid create shader module",
|
||||
),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
std::borrow::Cow::Borrowed(include_str!(
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ impl Blit {
|
|||
|
||||
let shader =
|
||||
device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
label: Some("iced_wgpu::triangle::blit_shader"),
|
||||
label: Some("iced_wgpu triangle blit_shader"),
|
||||
source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed(
|
||||
include_str!("../shader/blit.wgsl"),
|
||||
)),
|
||||
|
|
|
|||
|
|
@ -66,7 +66,19 @@ impl<Theme> Compositor<Theme> {
|
|||
log::info!("Selected: {:#?}", adapter.get_info());
|
||||
|
||||
let format = compatible_surface.as_ref().and_then(|surface| {
|
||||
surface.get_capabilities(&adapter).formats.first().copied()
|
||||
let capabilities = surface.get_capabilities(&adapter);
|
||||
|
||||
capabilities
|
||||
.formats
|
||||
.iter()
|
||||
.filter(|format| format.describe().srgb)
|
||||
.copied()
|
||||
.next()
|
||||
.or_else(|| {
|
||||
log::warn!("No sRGB format found!");
|
||||
|
||||
capabilities.formats.first().copied()
|
||||
})
|
||||
})?;
|
||||
|
||||
log::info!("Selected format: {:?}", format);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue