Open superdump opened 2 years ago
Wait... I saw MTLCompiler and started writing the ticket as I thought that was for compiling the shaders. But then when I looked back at the output in Xcode, it had actually terminated to lldb and showed that the error was with create_render_pipeline. Should this be a wgpu issue?
In bevy we are developing a preprocessor to enable modular reuse of shader code. I reworked the code to split types, bindings, and functions into separate files, and that was working. Then I made another change to pass all bindings as arguments to functions so that the order of importing/defining functions and bindings doesn't matter. The result for the main pbr shader is that it passes WGSL validation but the metal shader compiler seems to hang as I see this output when debugging in Xcode (note that it may have compiled multiple shaders and the earlier warnings about unused variables may be from those):
Here is the full preprocessed WGSL shader: test.txt
Using naga 0.8.0 on macOS 12.1 with Xcode 13.2.1.