Skip to content

[Impeller] Add GLSL/HLSL formatting to the engine repo #115677

@bdero

Description

@bdero

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#L30

This 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions