Open expenses opened 3 years ago
Yeah, I think we need to. Any code going through SPIRV -> Metal would require this (i.e. within gfx-portability). Also, similar code would be needed for WGSL-out.
I'm running into this issue. Personally I'd have preferred it if the MSL output included the needed function definition.
panicked at 'wgpu error: Validation Error
Caused by:
In Device::create_render_pipeline
note: label = `horizon_pipeline`
Internal error in VERTEX shader: MSL: UnsupportedCall("Inverse")
MSL doesn't natively have any functions for computing matrix inversions.
spirv-cross
handles this by adding functions that compute the inverse and calling those: https://github.com/KhronosGroup/SPIRV-Cross/blob/72a2ec4c1b56ce233e0da97a36f87af98927256c/spirv_msl.cpp#L4941-L5079.The code for these functions is quite long, and I think it's worth thinking about whether we even want to handle this case in the first place.