fix(heal): eliminate brush cursor mouse lag and stutter in desktop STUDIO by bypassing React reconciliation on pointermove

This commit is contained in:
2026-10-16 15:46:24 +07:00
parent 7e4bfd3da7
commit 9610d1b111
3 changed files with 84 additions and 52 deletions
+7 -1
View File
@@ -75,15 +75,21 @@ async function hasDevice(): Promise<boolean> {
}
}
let isWebGPUActive = false;
// WebGPU on the main thread: asynchronous and GPU-bound.
async function openSession(ort: typeof Ort): Promise<Ort.InferenceSession> {
if (await hasDevice()) {
try {
const gpu = await ort.InferenceSession.create(MODEL_URL, { executionProviders: ['webgpu'] });
if (await warmsUp(ort, gpu)) return gpu;
if (await warmsUp(ort, gpu)) {
isWebGPUActive = true;
return gpu;
}
await gpu.release();
} catch {}
}
isWebGPUActive = false;
return ort.InferenceSession.create(MODEL_URL, {
executionProviders: ['wasm'],
enableCpuMemArena: false,