[Impeller] Add GLSL/HLSL formatting to the engine repo #115677
Labels
e: impeller
Impeller rendering backend issues and features requests
engine
flutter/engine repository. See also e: labels.
P2
Important issues not at the top of the work list
I've been formatting GLSL code similarly to our C++ code using the formatting functionality provided by this vscode extension: https://github.com/stef-levesque/vscode-shader
The reason the formatting is remarkably similar to our C++ code is that it actually just runs the C++ formatter over it (which in my case is set to the clang-format executable that ships with our clang SDK)! It saves a temp source file with a
.cpp
extension and tricks vscode into running the cpp formatter: https://github.com/stef-levesque/vscode-shader/blob/f1c804839f9f58a6749c9a840187c5527b76b053/src/extension.ts#L30This has been giving me excellent results for both GLSL and HLSL, so perhaps we could just have
format.sh
run all shader files (.glsl, .hlsl, .vert, .frag, etc) through clang-format.The text was updated successfully, but these errors were encountered: