You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling wgpuDeviceCreateShaderModule, occasionally the call will fail with Invalid UTF-8 leading byte 0x00000090 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
Maybe the issue is related to #20124 and that the shader source string in WGPUShaderModuleWGSLDescriptor is non-owning? Sometimes the code works without issues.
The string in WGPUShaderModuleWGSLDescriptor is indeed non-owning. But it should certainly be valid for duration of the wgpuDeviceCreateShaderModule call, and proxying would block the calling thread to maintain that guarantee. I'm guessing that's what the 'sync' means, in:
LibraryWebGPU[key + '__proxy'] = 'sync';
It seems more likely the issue is in your code. Actually, looking more closely, I think the problem is that WGPUShaderModuleWGSLDescriptor requires a null-terminated string, but std::string_view::data() does not return one. (You need std::string::c_str(), which isn't available on std::string_view.) So unless you're manually null-terminating your string before it's passed here, we (Emscripten) will read garbage past the end of your string.
Uh oh!
There was an error while loading. Please reload this page.
When calling
wgpuDeviceCreateShaderModule
, occasionally the call will fail withInvalid UTF-8 leading byte 0x00000090 encountered when deserializing a UTF-8 string in wasm memory to a JS string!
Code that's causing the error:
The shader string:
Call stack:

Maybe the issue is related to #20124 and that the shader source string in
WGPUShaderModuleWGSLDescriptor
is non-owning? Sometimes the code works without issues.Version of emscripten/emsdk:
The text was updated successfully, but these errors were encountered: