commit
78924fa299
4 changed files with 6 additions and 11 deletions
|
|
@ -72,7 +72,6 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
backends: backend,
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
let surface = unsafe { instance.create_surface(&window) }?;
|
||||
|
||||
let (format, (device, queue)) = futures::executor::block_on(async {
|
||||
|
|
@ -99,9 +98,8 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
capabilities
|
||||
.formats
|
||||
.iter()
|
||||
.filter(|format| format.describe().srgb)
|
||||
.copied()
|
||||
.next()
|
||||
.find(wgpu::TextureFormat::is_srgb)
|
||||
.or_else(|| capabilities.formats.first().copied())
|
||||
.expect("Get preferred format"),
|
||||
adapter
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ spirv = ["wgpu/spirv"]
|
|||
webgl = ["wgpu/webgl"]
|
||||
|
||||
[dependencies]
|
||||
wgpu = "0.15"
|
||||
wgpu_glyph = "0.19"
|
||||
wgpu = "0.16"
|
||||
wgpu_glyph = "0.20"
|
||||
glyph_brush = "0.7"
|
||||
raw-window-handle = "0.5"
|
||||
log = "0.4"
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ pub const SIZE: u32 = 2048;
|
|||
use iced_graphics::image;
|
||||
use iced_graphics::Size;
|
||||
|
||||
use std::num::NonZeroU32;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Atlas {
|
||||
texture: wgpu::Texture,
|
||||
|
|
@ -209,8 +207,8 @@ impl Atlas {
|
|||
buffer,
|
||||
layout: wgpu::ImageDataLayout {
|
||||
offset: offset as u64,
|
||||
bytes_per_row: NonZeroU32::new(4 * image_width + padding),
|
||||
rows_per_image: NonZeroU32::new(image_height),
|
||||
bytes_per_row: Some(4 * image_width + padding),
|
||||
rows_per_image: Some(image_height),
|
||||
},
|
||||
},
|
||||
wgpu::ImageCopyTexture {
|
||||
|
|
|
|||
|
|
@ -71,9 +71,8 @@ impl<Theme> Compositor<Theme> {
|
|||
capabilities
|
||||
.formats
|
||||
.iter()
|
||||
.filter(|format| format.describe().srgb)
|
||||
.copied()
|
||||
.next()
|
||||
.find(wgpu::TextureFormat::is_srgb)
|
||||
.or_else(|| {
|
||||
log::warn!("No sRGB format found!");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue