Skip to content

[HLSL][clang-format] Add Language Mode for HLSL #126257

@V-FEXrt

Description

@V-FEXrt

clang-format supports many different languages and as part of that support it can switch between different languages to add/remove formatting rules. Right now clang-format can fairly reasonably format HLSL running under C++ mode however annotation syntax could use better support.

Adding an HLSL mode is the first step in supporting HLSL specific formatting rules.

Automatically determining HLSL as the source language is a downstream task that may or may not actually be possible. Plenty of HLSL programs will not have obvious differences from C++ so autodetection may have to be limited to huristics or file extension. This is still an open design question.

AC:

  • A test in the flavor of this one verifies language mode is HLSL

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions