diff --git a/src/sample/worker/main.ts b/src/sample/worker/main.ts index 4a2cc95f..30ce76c5 100644 --- a/src/sample/worker/main.ts +++ b/src/sample/worker/main.ts @@ -14,12 +14,6 @@ const init: SampleInit = async ({ canvas, pageState }) => { // complexity. Here we establish a convention that all messages to and from the worker will // have a `type` field that we can use to determine the content of the message. switch (ev.data.type) { - case 'log': { - // Workers don't have a built-in mechanism for logging to the console, so it's useful to - // create a way to echo console messages. - console.log(ev.data.message); - break; - } default: { console.error(`Unknown Message Type: ${ev.data.type}`); } diff --git a/src/sample/worker/worker.ts b/src/sample/worker/worker.ts index 2d26c45f..c71d9d20 100644 --- a/src/sample/worker/worker.ts +++ b/src/sample/worker/worker.ts @@ -21,10 +21,9 @@ self.addEventListener('message', (ev) => { try { init(ev.data.offscreenCanvas); } catch (err) { - self.postMessage({ - type: 'log', - message: `Error while initializing WebGPU in worker process: ${err.message}`, - }); + console.error( + `Error while initializing WebGPU in worker process: ${err.message}` + ); } break; }