8000 Remove `Arc` from `override_image` by DJMcNab · Pull Request #802 · linebender/vello · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove Arc from override_image #802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
9 changes: 3 additions & 6 deletions vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@ use vello_encoding::Resolver;
use wgpu_engine::{ExternalResource, WgpuEngine};

#[cfg(feature = "wgpu")]
use std::{
num::NonZeroUsize,
sync::{atomic::AtomicBool, Arc},
};
use std::{num::NonZeroUsize, sync::atomic::AtomicBool};
#[cfg(feature = "wgpu")]
use wgpu::{Device, Queue, SurfaceTexture, TextureFormat, TextureView};
#[cfg(all(feature = "wgpu", feature = "wgpu-profiler"))]
Expand Down Expand Up @@ -584,8 +581,8 @@ impl Renderer {
pub fn override_image(
&mut self,
image: &peniko::Image,
texture: Option<wgpu::TexelCopyTextureInfoBase<Arc<wgpu::Texture>>>,
) -> Option<wgpu::TexelCopyTextureInfoBase<Arc<wgpu::Texture>>> {
texture: Option<wgpu::TexelCopyTextureInfoBase<wgpu::Texture>>,
) -> Option<wgpu::TexelCopyTextureInfoBase<wgpu::Texture>> {
match texture {
Some(texture) => self.engine.image_overrides.insert(image.data.id(), texture),
None => self.engine.image_overrides.remove(&image.data.id()),
Expand Down
3 changes: 1 addition & 2 deletions vello/src/wgpu_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::borrow::Cow;
use std::cell::RefCell;
use std::collections::hash_map::Entry;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;

use vello_shaders::cpu::CpuBinding;

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

enum PipelineState {
Expand Down
0