wgpu calls createBuffer
on an undefined
from a worker thread on Wasm
#2884
Labels
createBuffer
on an undefined
from a worker thread on Wasm
#2884
Description
wgpu attempts to execute the
createBuffer
method on anundefined
when running in a worker thread on the targetwasm32-unknown-unknown
. The instance, adapter, surface, and device were created on the main thread.Repro steps
A runnable example is here, the source code for which is here; see
wasm.rs
andcore/src/lib.rs
. More generic instructions are described below.wasm32-unknown-unknown
.main
function using#[wasm_bindgen]
.main
, create a wgpu instance, adapter, device, and surface.wasm_thread
) in which a vertex buffer is created and initialized with the device returned by wgpu.Expected vs observed behavior
I expect the vertex buffer creation to be successful, after which render passes would occur, the command queue would be submitted, and the surface frame would ultimately be presented.
Instead, I observe that attempting to create the vertex buffer from a worker thread crashes the Wasm process.
Extra materials
On Microsoft Edge (Chromium-based), I receive the following error:
On Firefox, I receive the following error:
Platform
Windows 11. wgpu 0.13 (latest minor release). naga 0.9.
The text was updated successfully, but these errors were encountered: