Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

perf(desktop): add background cache to shared GPU context

Richie McIlroyd6b00fdc1878
diff --git a/apps/desktop/src-tauri/src/gpu_context.rs b/apps/desktop/src-tauri/src/gpu_context.rs
index 99a8de264..2894d8897 100644
--- a/apps/desktop/src-tauri/src/gpu_context.rs
+++ b/apps/desktop/src-tauri/src/gpu_context.rs
@@ -44,6 +44,7 @@ pub struct SharedGpuContext {
pub adapter: Arc<wgpu::Adapter>,
pub instance: Arc<wgpu::Instance>,
pub is_software_adapter: bool,
+ pub background_cache: Arc<cap_rendering::BackgroundTextureCache>,
}
static GPU: OnceCell<Option<SharedGpuContext>> = OnceCell::const_new();
@@ -120,6 +121,7 @@ async fn init_gpu_inner() -> Option<SharedGpuContext> {
adapter: Arc::new(adapter),
instance: Arc::new(instance),
is_software_adapter,
+ background_cache: Arc::new(cap_rendering::BackgroundTextureCache::default()),
})
}