perf: build hatch/image/mesh caches off the UI thread

Parsing + DerivedCaches construction now runs entirely in a dedicated
OS thread inside open_path(). FileOpened handler only assigns the
pre-built caches, keeping the UI thread free during file load.

- Add build_derived_caches(): parallel hatch + mesh tessellation via rayon
- Extend Message::FileOpened / open_path return type with DerivedCaches
- Drop populate_*_from_document() calls from FileOpened handler
This commit is contained in:
Hakan Seven committed 2026-05-06 23:04:53 +03:00
1 parent 45f9f96c93
commit 2da3640b45
4 files changed
+172 -51

No files matched your search

+1 -1
View File
@@ -212,7 +212,7 @@ pub enum DsField {
pub enum Message {
Tick(Instant),
OpenFile,
FileOpened(Result<(String, PathBuf, CadDocument), String>),
FileOpened(Result<(String, PathBuf, CadDocument, crate::scene::DerivedCaches), String>),
SaveFile,
SaveAs,
// ── Custom Save-As dialog ─────────────────────────────────────────────