Random CreateRenderPipelineError::Internal with empty error message on webgl
Description Unfortunately I don't have much details to give here, there's two errors at play: some unknown mystery error, and the fact that the error given to us is totally empty and unhelpful.
I've noticed that Ruffle been getting a lot of crash reports that look something like:
Error: panicked at /home/runner/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/e128d6c/wgpu/src/backend/wgpu_core.rs:3009:5:
wgpu error: Validation Error
Caused by:
In Device::create_render_pipeline
Internal error in ShaderStages(VERTEX) shader:
at n.wbg.__wbg_new_3a66822ed076951c (https://ruffle.rs/demo/assets/ruffle_web-wasm_extensions-Ma6QDEU5.js:2:68272)
at core::ops::function::FnOnce::call_once{{vtable.shim}}::h3f9d79438cea651a (wasm://wasm/0380fec6:wasm-function[11307]:0xa77874)
at std::panicking::rust_panic_with_hook::h62090d3fc0630473 (wasm://wasm/0380fec6:wasm-function[6911]:0x949326)
at core::panicking::panic_fmt::hd79411a297d06dc8 (wasm://wasm/0380fec6:wasm-function[11021]:0xa70e76)
at core::ops::function::Fn::call::h87315d7350750bed (wasm://wasm/0380fec6:wasm-function[7215]:0x95f72d)
at wgpu::backend::wgpu_core::ErrorSinkRaw::handle_error::h6d2e98271849e140 (wasm://wasm/0380fec6:wasm-function[5733]:0x8dba3e)
at <T as wgpu::context::DynContext>::device_create_render_pipeline::h074ce93af74134bb (wasm://wasm/0380fec6:wasm-function[9241]:0xa00ce7)
at wgpu::Device::create_render_pipeline::h8a1111aeefee88f6 (wasm://wasm/0380fec6:wasm-function[7687]:0x988f42)
at ruffle_render_wgpu::filters::color_matrix::ColorMatrixFilter::apply::hf2c4c24820bd3ed3 (wasm://wasm/0380fec6:wasm-function[1594]:0x4aa9e5)
at ruffle_render_wgpu::filters::Filters::apply::h0a3b4c518de7d64f (wasm://wasm/0380fec6:wasm-function[1423]:0x44b61d
It's never the same shader twice, and seems to happen on different OSes but seemingly always a Chromium browser. It exists in 0.19.1 and was first reported to us in wgpu 0.16.1.
The message never provides details, it looks like the error field of the struct is empty. I'm guessing one or more of the error flows on webgl is fallible (or just wrong), which is silencing the real error at play.
I'd suggest at the minimum we just add our own message that shows which part of the shader compilation failed, so at least we know what spot to look at.
Repro steps Not been able to repro it myself, but in theory go to https://ruffle.rs/demo and see if it panics.
Expected vs observed behavior Expected some details as to why it errors, so we can look at fixing it.
Extra materials None
Platform Affects wgpu 0.61.1 to 0.19.1 Seen on Windows, Linux, Chrome OS, and supposedly an Xbox One. Seen on Chrome and Edge.