Small improvements to cache (#130)
* Remove `Arc` around `RenderPipeline` It is not necessary anymore in last `wgpu` version. * Replace `RwLock` with `Mutex` It was only used for writing.
This commit is contained in:
parent
114cfa3e02
commit
505f12f6ce
3 changed files with 13 additions and 14 deletions
|
@ -4,7 +4,7 @@ use crate::{
|
|||
use etagere::{size2, Allocation, BucketedAtlasAllocator};
|
||||
use lru::LruCache;
|
||||
use rustc_hash::FxHasher;
|
||||
use std::{collections::HashSet, hash::BuildHasherDefault, sync::Arc};
|
||||
use std::{collections::HashSet, hash::BuildHasherDefault};
|
||||
use wgpu::{
|
||||
BindGroup, DepthStencilState, Device, Extent3d, MultisampleState, Origin3d, Queue,
|
||||
RenderPipeline, TexelCopyBufferLayout, TexelCopyTextureInfo, Texture, TextureAspect,
|
||||
|
@ -329,7 +329,7 @@ impl TextAtlas {
|
|||
device: &Device,
|
||||
multisample: MultisampleState,
|
||||
depth_stencil: Option<DepthStencilState>,
|
||||
) -> Arc<RenderPipeline> {
|
||||
) -> RenderPipeline {
|
||||
self.cache
|
||||
.get_or_create_pipeline(device, self.format, multisample, depth_stencil)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue