From 46838e8043762e647742c6ee474ad9cc59f0d50b Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Wed, 23 Oct 2024 02:43:24 +0300 Subject: [PATCH] worker auto mode --- prismarine-viewer/examples/webgpuRendererMain.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prismarine-viewer/examples/webgpuRendererMain.ts b/prismarine-viewer/examples/webgpuRendererMain.ts index 22c1df7be..9a0a801ab 100644 --- a/prismarine-viewer/examples/webgpuRendererMain.ts +++ b/prismarine-viewer/examples/webgpuRendererMain.ts @@ -77,8 +77,8 @@ export const removeBlocksSection = (key) => { // do not use worker in safari, it is slow const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) -// const USE_WORKER = !isSafari -const USE_WORKER = new URLSearchParams(window.location.search).get('worker') === 'true' +const workerParam = new URLSearchParams(window.location.search).get('webgpuWorker') +const USE_WORKER = workerParam ? workerParam === 'true' : !isSafari let playground = false export const initWebgpuRenderer = async (postRender = () => { }, playgroundModeInWorker = false, actuallyPlayground = false) => {