Skip to content

Commit dd2a62e

Browse files
committed
Remove unnecessary Arc
Since `wgpu` 24, most types are ref-counted so this is not necessary anymore.
1 parent 7a97773 commit dd2a62e

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

wgpu/src/image/atlas.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,21 @@ pub const SIZE: u32 = 2048;
1515
use crate::core::Size;
1616
use crate::graphics::color;
1717

18-
use std::sync::Arc;
19-
2018
#[derive(Debug)]
2119
pub struct Atlas {
2220
backend: wgpu::Backend,
2321
texture: wgpu::Texture,
2422
texture_view: wgpu::TextureView,
2523
texture_bind_group: wgpu::BindGroup,
26-
texture_layout: Arc<wgpu::BindGroupLayout>,
24+
texture_layout: wgpu::BindGroupLayout,
2725
layers: Vec<Layer>,
2826
}
2927

3028
impl Atlas {
3129
pub fn new(
3230
device: &wgpu::Device,
3331
backend: wgpu::Backend,
34-
texture_layout: Arc<wgpu::BindGroupLayout>,
32+
texture_layout: wgpu::BindGroupLayout,
3533
) -> Self {
3634
let layers = match backend {
3735
// On the GL backend we start with 2 layers, to help wgpu figure

wgpu/src/image/cache.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use crate::core::{self, Size};
22
use crate::image::atlas::{self, Atlas};
33

4-
use std::sync::Arc;
5-
64
#[derive(Debug)]
75
pub struct Cache {
86
atlas: Atlas,
@@ -16,7 +14,7 @@ impl Cache {
1614
pub fn new(
1715
device: &wgpu::Device,
1816
backend: wgpu::Backend,
19-
layout: Arc<wgpu::BindGroupLayout>,
17+
layout: wgpu::BindGroupLayout,
2018
) -> Self {
2119
Self {
2220
atlas: Atlas::new(device, backend, layout),

wgpu/src/image/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use crate::core::{Rectangle, Size, Transformation};
1515
use bytemuck::{Pod, Zeroable};
1616

1717
use std::mem;
18-
use std::sync::Arc;
1918

2019
pub use crate::graphics::Image;
2120

@@ -27,7 +26,7 @@ pub struct Pipeline {
2726
backend: wgpu::Backend,
2827
nearest_sampler: wgpu::Sampler,
2928
linear_sampler: wgpu::Sampler,
30-
texture_layout: Arc<wgpu::BindGroupLayout>,
29+
texture_layout: wgpu::BindGroupLayout,
3130
constant_layout: wgpu::BindGroupLayout,
3231
}
3332

@@ -196,7 +195,7 @@ impl Pipeline {
196195
backend,
197196
nearest_sampler,
198197
linear_sampler,
199-
texture_layout: Arc::new(texture_layout),
198+
texture_layout,
200199
constant_layout,
201200
}
202201
}

0 commit comments

Comments
 (0)