fix(heal): eliminate brush cursor mouse lag and stutter in desktop STUDIO by bypassing React reconciliation on pointermove
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user