From 04df889cacfc4dfe93c2640b75f65eaafa060dba Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 19 Feb 2024 08:18:51 +0100 Subject: Use two layers for `image::atlas` only on `Gl` backend --- wgpu/src/image.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'wgpu/src/image.rs') diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index 06c22870..c8e4a4c2 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -176,7 +176,11 @@ impl Data { } impl Pipeline { - pub fn new(device: &wgpu::Device, format: wgpu::TextureFormat) -> Self { + pub fn new( + device: &wgpu::Device, + format: wgpu::TextureFormat, + backend: wgpu::Backend, + ) -> Self { let nearest_sampler = device.create_sampler(&wgpu::SamplerDescriptor { address_mode_u: wgpu::AddressMode::ClampToEdge, address_mode_v: wgpu::AddressMode::ClampToEdge, @@ -318,7 +322,7 @@ impl Pipeline { multiview: None, }); - let texture_atlas = Atlas::new(device); + let texture_atlas = Atlas::new(device, backend); let texture = device.create_bind_group(&wgpu::BindGroupDescriptor { label: Some("iced_wgpu::image texture atlas bind group"), -- cgit