diff options
author | 2021-08-01 20:38:34 +0200 | |
---|---|---|
committer | 2021-08-03 11:30:45 +0200 | |
commit | d7975a9de591a57b265c2d62078a65ffb9209696 (patch) | |
tree | 1dc26f557bc84f059de82f436895858642f635e8 /wgpu/src/backend.rs | |
parent | a08e4ebccbb72f9cf6fca01047e0b46a482ca9ea (diff) | |
download | iced-d7975a9de591a57b265c2d62078a65ffb9209696.tar.gz iced-d7975a9de591a57b265c2d62078a65ffb9209696.tar.bz2 iced-d7975a9de591a57b265c2d62078a65ffb9209696.zip |
wgpu: Use the preferred texture format of the surface
Signed-off-by: Tilmann Meyer <me@atiltedtree.dev>
Diffstat (limited to 'wgpu/src/backend.rs')
-rw-r--r-- | wgpu/src/backend.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs index 783079f3..4f34045b 100644 --- a/wgpu/src/backend.rs +++ b/wgpu/src/backend.rs @@ -30,23 +30,24 @@ pub struct Backend { impl Backend { /// Creates a new [`Backend`]. - pub fn new(device: &wgpu::Device, settings: Settings) -> Self { + pub fn new( + device: &wgpu::Device, + settings: Settings, + format: wgpu::TextureFormat, + ) -> Self { let text_pipeline = text::Pipeline::new( device, - settings.format, + format, settings.default_font, settings.text_multithreading, ); - let quad_pipeline = quad::Pipeline::new(device, settings.format); - let triangle_pipeline = triangle::Pipeline::new( - device, - settings.format, - settings.antialiasing, - ); + let quad_pipeline = quad::Pipeline::new(device, format); + let triangle_pipeline = + triangle::Pipeline::new(device, format, settings.antialiasing); #[cfg(any(feature = "image_rs", feature = "svg"))] - let image_pipeline = image::Pipeline::new(device, settings.format); + let image_pipeline = image::Pipeline::new(device, format); Self { quad_pipeline, |