Skip to content

Commit ff7b3fd

Browse files
committed
Prewarm composite pipeline on background thread
1 parent e3f5b8b commit ff7b3fd

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

apps/desktop/src-tauri/src/gpu_context.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ pub async fn get_shared_gpu() -> Option<&'static SharedGpuContext> {
158158

159159
pub fn prewarm_gpu() {
160160
tokio::spawn(async {
161-
get_shared_gpu().await;
161+
let gpu = get_shared_gpu().await;
162+
if let Some(gpu) = gpu {
163+
let device = gpu.device.clone();
164+
std::thread::Builder::new()
165+
.name("pipeline-prewarm".into())
166+
.spawn(move || {
167+
cap_rendering::prewarm_composite_pipeline(&device);
168+
})
169+
.ok();
170+
}
162171
});
163172
}

0 commit comments

Comments
 (0)