Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Prewarm composite pipeline on background thread

Richie McIlroyff7b3fddf83f
diff --git a/apps/desktop/src-tauri/src/gpu_context.rs b/apps/desktop/src-tauri/src/gpu_context.rs
index 4fb5fe6da..726cc4846 100644
--- a/apps/desktop/src-tauri/src/gpu_context.rs
+++ b/apps/desktop/src-tauri/src/gpu_context.rs
@@ -158,6 +158,15 @@ pub async fn get_shared_gpu() -> Option<&'static SharedGpuContext> {
pub fn prewarm_gpu() {
tokio::spawn(async {
- get_shared_gpu().await;
+ let gpu = get_shared_gpu().await;
+ if let Some(gpu) = gpu {
+ let device = gpu.device.clone();
+ std::thread::Builder::new()
+ .name("pipeline-prewarm".into())
+ .spawn(move || {
+ cap_rendering::prewarm_composite_pipeline(&device);
+ })
+ .ok();
+ }
});
}