gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.35k stars 548 forks source link

WebGL `sc_internal` not defined #3594

Closed cwfitzgerald closed 3 years ago

cwfitzgerald commented 3 years ago

Once #3593 and another issue are placated, it appears that spirv-cross is having issues allocating memory:

Stack trace ``` Uncaught (in promise) ReferenceError: sc_internal is not defined at imports.wbg.__wbg_malloc_fc39ab59a2a5e6a8 (cube.js:434) at spirv_cross::emscripten::_malloc::h2bd203b647a896ce (:8000/:wasm-function[23586]:0x90d5d8) at spirv_cross::emscripten::Module::allocate::h523f3f6d77cf39b1 (:8000/:wasm-function[25320]:0x92ed7d) at spirv_cross::bindings_wasm_functions::sc_internal_compiler_glsl_new::ha3a97f050dbb5f1c (:8000/:wasm-function[3531]:0x59a2f9) at spirv_cross::glsl:: for spirv_cross::spirv::Ast>::parse::ha922caa43c53fab5 (:8000/:wasm-function[6879]:0x6cbeb1) at spirv_cross::spirv::Ast::parse::h56292754440b8d4c (:8000/:wasm-function[30912]:0x98c698) at gfx_backend_gl::device::Device::parse_spirv::he5a1f28c38e09329 (:8000/:wasm-function[11888]:0x7cebbe) at gfx_backend_gl::device::Device::compile_shader::he28c39fc1dcd0adb (:8000/:wasm-function[435]:0x1b4bdc) at gfx_backend_gl::device::Device::create_shader_program::h88d96bb228137f3f (:8000/:wasm-function[412]:0x1906bf) at >::create_graphics_pipeline::hcec96e8a5b5ce4be (:8000/:wasm-function[420]:0x19e1f1) ```

I'm not sure how to deal with this.

You can repro by running the wgpu cube example with this branch overridden: https://github.com/cwfitzgerald/gfx/tree/webgl-fixes

cwfitzgerald commented 3 years ago

This was caused by missing instructions in wgpu-rs's installation instructions.