diff options
author | 2024-02-19 08:18:51 +0100 | |
---|---|---|
committer | 2024-02-19 08:18:51 +0100 | |
commit | 04df889cacfc4dfe93c2640b75f65eaafa060dba (patch) | |
tree | a59fd2d8c360a3a7b81d079e733b715e4a49db0d /wgpu/src/backend.rs | |
parent | 4272090d36caf2937c170d3b28d1be1acc94a440 (diff) | |
download | iced-04df889cacfc4dfe93c2640b75f65eaafa060dba.tar.gz iced-04df889cacfc4dfe93c2640b75f65eaafa060dba.tar.bz2 iced-04df889cacfc4dfe93c2640b75f65eaafa060dba.zip |
Use two layers for `image::atlas` only on `Gl` backend
Diffstat (limited to 'wgpu/src/backend.rs')
-rw-r--r-- | wgpu/src/backend.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs index 77b6fa83..09ddbe4d 100644 --- a/wgpu/src/backend.rs +++ b/wgpu/src/backend.rs @@ -27,7 +27,6 @@ pub struct Backend { text_pipeline: text::Pipeline, triangle_pipeline: triangle::Pipeline, pipeline_storage: pipeline::Storage, - #[cfg(any(feature = "image", feature = "svg"))] image_pipeline: image::Pipeline, } @@ -35,6 +34,7 @@ pub struct Backend { impl Backend { /// Creates a new [`Backend`]. pub fn new( + _adapter: &wgpu::Adapter, device: &wgpu::Device, queue: &wgpu::Queue, settings: Settings, @@ -46,7 +46,11 @@ impl Backend { triangle::Pipeline::new(device, format, settings.antialiasing); #[cfg(any(feature = "image", feature = "svg"))] - let image_pipeline = image::Pipeline::new(device, format); + let image_pipeline = { + let backend = _adapter.get_info().backend; + + image::Pipeline::new(device, format, backend) + }; Self { quad_pipeline, |