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:
Alphyr 2025-02-05 03:04:11 +01:00 committed by Héctor Ramón Jiménez
parent 114cfa3e02
commit 505f12f6ce
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 13 additions and 14 deletions

View file

@ -2,7 +2,7 @@ use crate::{
ColorMode, FontSystem, GlyphDetails, GlyphToRender, GpuCacheStatus, PrepareError, RenderError,
SwashCache, SwashContent, TextArea, TextAtlas, Viewport,
};
use std::{num::NonZeroU64, slice, sync::Arc};
use std::{num::NonZeroU64, slice};
use wgpu::util::StagingBelt;
use wgpu::{
Buffer, BufferDescriptor, BufferUsages, CommandEncoder, DepthStencilState, Device, Extent3d,
@ -15,7 +15,7 @@ pub struct TextRenderer {
staging_belt: StagingBelt,
vertex_buffer: Buffer,
vertex_buffer_size: u64,
pipeline: Arc<RenderPipeline>,
pipeline: RenderPipeline,
glyph_vertices: Vec<GlyphToRender>,
glyphs_to_render: u32,
}