Skip to content

Commit 05b7d69

Browse files
authored
Remove Arc from override_image (#802)
A gain from wgpu 0.24
1 parent 2f08fe7 commit 05b7d69

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

vello/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ use vello_encoding::Resolver;
170170
use wgpu_engine::{ExternalResource, WgpuEngine};
171171

172172
#[cfg(feature = "wgpu")]
173-
use std::{
174-
num::NonZeroUsize,
175-
sync::{atomic::AtomicBool, Arc},
176-
};
173+
use std::{num::NonZeroUsize, sync::atomic::AtomicBool};
177174
#[cfg(feature = "wgpu")]
178175
use wgpu::{Device, Queue, SurfaceTexture, TextureFormat, TextureView};
179176
#[cfg(all(feature = "wgpu", feature = "wgpu-profiler"))]
@@ -584,8 +581,8 @@ impl Renderer {
584581
pub fn override_image(
585582
&mut self,
586583
image: &peniko::Image,
587-
texture: Option<wgpu::TexelCopyTextureInfoBase<Arc<wgpu::Texture>>>,
588-
) -> Option<wgpu::TexelCopyTextureInfoBase<Arc<wgpu::Texture>>> {
584+
texture: Option<wgpu::TexelCopyTextureInfoBase<wgpu::Texture>>,
585+
) -> Option<wgpu::TexelCopyTextureInfoBase<wgpu::Texture>> {
589586
match texture {
590587
Some(texture) => self.engine.image_overrides.insert(image.data.id(), texture),
591588
None => self.engine.image_overrides.remove(&image.data.id()),

vello/src/wgpu_engine.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::borrow::Cow;
55
use std::cell::RefCell;
66
use std::collections::hash_map::Entry;
77
use std::collections::{HashMap, HashSet};
8-
use std::sync::Arc;
98

109
use vello_shaders::cpu::CpuBinding;
1110

@@ -41,7 +40,7 @@ pub(crate) struct WgpuEngine {
4140
/// Overrides from a specific `Image::data`'s [`id`](peniko::Blob::id) to a wgpu `Texture`.
4241
///
4342
/// The `Texture` should have the same size as the `Image`.
44-
pub(crate) image_overrides: HashMap<u64, wgpu::TexelCopyTextureInfoBase<Arc<Texture>>>,
43+
pub(crate) image_overrides: HashMap<u64, wgpu::TexelCopyTextureInfoBase<Texture>>,
4544
}
4645

4746
enum PipelineState {

0 commit comments

Comments
 (0)