diff --git a/.github/linters/.clang-format b/.github/linters/.clang-format index 842e0331..4f7d7722 100644 --- a/.github/linters/.clang-format +++ b/.github/linters/.clang-format @@ -46,9 +46,6 @@ BraceWrapping: BeforeLambdaBody: true SplitEmptyFunction: false SplitEmptyRecord: false -#requires clang-format 22 -#BreakAfterOpenBracketFunction: true -#BreakBeforeCloseBracketFunction: true BreakBeforeBinaryOperators: All BreakBeforeTernaryOperators: false BreakConstructorInitializers: BeforeColon @@ -70,8 +67,6 @@ PointerAlignment: Left ReflowComments: true SortIncludes: false SpaceAfterCStyleCast: false -#requires clang format 21 -#SpaceAfterOperatorKeyword: true SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeCaseColon: false diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7923ae89..b0e126ff 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - name: Lint Code Base - uses: super-linter/super-linter@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0 + uses: super-linter/super-linter@2da136927bd4a73596db63044b504547c62cb854 # v9.0.0 env: DEFAULT_BRANCH: origin/main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Inc/Effects.h b/Inc/Effects.h index c9607ff0..23a63c77 100644 --- a/Inc/Effects.h +++ b/Inc/Effects.h @@ -1030,8 +1030,7 @@ namespace DirectX virtual void __cdecl CreateTexture(_In_z_ const wchar_t* name, _In_opt_ ID3D11DeviceContext* deviceContext, - _Outptr_ ID3D11ShaderResourceView** textureView) - = 0; + _Outptr_ ID3D11ShaderResourceView** textureView) = 0; protected: IEffectFactory() = default; @@ -1057,8 +1056,8 @@ namespace DirectX DIRECTX_TOOLKIT_API std::shared_ptr __cdecl CreateEffect(_In_ const EffectInfo& info, _In_opt_ ID3D11DeviceContext* deviceContext) override; DIRECTX_TOOLKIT_API void __cdecl CreateTexture(_In_z_ const wchar_t* name, - _In_opt_ ID3D11DeviceContext* deviceContext, - _Outptr_ ID3D11ShaderResourceView** textureView) override; + _In_opt_ ID3D11DeviceContext* deviceContext, + _Outptr_ ID3D11ShaderResourceView** textureView) override; // Settings. DIRECTX_TOOLKIT_API void __cdecl ReleaseCache(); @@ -1098,8 +1097,8 @@ namespace DirectX DIRECTX_TOOLKIT_API std::shared_ptr __cdecl CreateEffect(_In_ const EffectInfo& info, _In_opt_ ID3D11DeviceContext* deviceContext) override; DIRECTX_TOOLKIT_API void __cdecl CreateTexture(_In_z_ const wchar_t* name, - _In_opt_ ID3D11DeviceContext* deviceContext, - _Outptr_ ID3D11ShaderResourceView** textureView) override; + _In_opt_ ID3D11DeviceContext* deviceContext, + _Outptr_ ID3D11ShaderResourceView** textureView) override; // Settings. DIRECTX_TOOLKIT_API void __cdecl ReleaseCache(); @@ -1138,8 +1137,8 @@ namespace DirectX DIRECTX_TOOLKIT_API std::shared_ptr __cdecl CreateEffect(_In_ const EffectInfo& info, _In_opt_ ID3D11DeviceContext* deviceContext) override; DIRECTX_TOOLKIT_API void __cdecl CreateTexture(_In_z_ const wchar_t* name, - _In_opt_ ID3D11DeviceContext* deviceContext, - _Outptr_ ID3D11ShaderResourceView** textureView) override; + _In_opt_ ID3D11DeviceContext* deviceContext, + _Outptr_ ID3D11ShaderResourceView** textureView) override; // Settings. DIRECTX_TOOLKIT_API void __cdecl ReleaseCache(); @@ -1184,8 +1183,8 @@ namespace DirectX DIRECTX_TOOLKIT_API std::shared_ptr __cdecl CreateEffect(_In_ const EffectInfo& info, _In_opt_ ID3D11DeviceContext* deviceContext) override; DIRECTX_TOOLKIT_API void __cdecl CreateTexture(_In_z_ const wchar_t* name, - _In_opt_ ID3D11DeviceContext* deviceContext, - _Outptr_ ID3D11ShaderResourceView** textureView) override; + _In_opt_ ID3D11DeviceContext* deviceContext, + _Outptr_ ID3D11ShaderResourceView** textureView) override; // DGSL methods. struct DIRECTX_TOOLKIT_API DGSLEffectInfo : public EffectInfo diff --git a/Inc/PostProcess.h b/Inc/PostProcess.h index 89a8e7d8..d244e57e 100644 --- a/Inc/PostProcess.h +++ b/Inc/PostProcess.h @@ -54,8 +54,7 @@ namespace DirectX IPostProcess& operator=(const IPostProcess&) = delete; virtual void __cdecl Process(_In_ ID3D11DeviceContext* deviceContext, - _In_ std::function setCustomState = nullptr) - = 0; + _In_ std::function setCustomState = nullptr) = 0; protected: IPostProcess() = default; diff --git a/Inc/SimpleMath.h b/Inc/SimpleMath.h index 6fa6e9b2..60706bb2 100644 --- a/Inc/SimpleMath.h +++ b/Inc/SimpleMath.h @@ -335,9 +335,9 @@ namespace DirectX static void Transform(const Vector2& v, const Matrix& m, Vector2& result) noexcept; static Vector2 Transform(const Vector2& v, const Matrix& m) noexcept; static void Transform(_In_reads_(count) const Vector2* varray, - size_t count, - const Matrix& m, - _Out_writes_(count) Vector2* resultArray) noexcept; + size_t count, + const Matrix& m, + _Out_writes_(count) Vector2* resultArray) noexcept; static void Transform(const Vector2& v, const Matrix& m, Vector4& result) noexcept; static void Transform(_In_reads_(count) const Vector2* varray, @@ -348,9 +348,9 @@ namespace DirectX static void TransformNormal(const Vector2& v, const Matrix& m, Vector2& result) noexcept; static Vector2 TransformNormal(const Vector2& v, const Matrix& m) noexcept; static void TransformNormal(_In_reads_(count) const Vector2* varray, - size_t count, - const Matrix& m, - _Out_writes_(count) Vector2* resultArray) noexcept; + size_t count, + const Matrix& m, + _Out_writes_(count) Vector2* resultArray) noexcept; // Constants static const Vector2 Zero; @@ -543,9 +543,9 @@ namespace DirectX static void Transform(const Vector3& v, const Matrix& m, Vector3& result) noexcept; static Vector3 Transform(const Vector3& v, const Matrix& m) noexcept; static void Transform(_In_reads_(count) const Vector3* varray, - size_t count, - const Matrix& m, - _Out_writes_(count) Vector3* resultArray) noexcept; + size_t count, + const Matrix& m, + _Out_writes_(count) Vector3* resultArray) noexcept; static void Transform(const Vector3& v, const Matrix& m, Vector4& result) noexcept; static void Transform(_In_reads_(count) const Vector3* varray, @@ -556,9 +556,9 @@ namespace DirectX static void TransformNormal(const Vector3& v, const Matrix& m, Vector3& result) noexcept; static Vector3 TransformNormal(const Vector3& v, const Matrix& m) noexcept; static void TransformNormal(_In_reads_(count) const Vector3* varray, - size_t count, - const Matrix& m, - _Out_writes_(count) Vector3* resultArray) noexcept; + size_t count, + const Matrix& m, + _Out_writes_(count) Vector3* resultArray) noexcept; // Constants static const Vector3 Zero; @@ -732,9 +732,9 @@ namespace DirectX static void Transform(const Vector4& v, const Matrix& m, Vector4& result) noexcept; static Vector4 Transform(const Vector4& v, const Matrix& m) noexcept; static void Transform(_In_reads_(count) const Vector4* varray, - size_t count, - const Matrix& m, - _Out_writes_(count) Vector4* resultArray) noexcept; + size_t count, + const Matrix& m, + _Out_writes_(count) Vector4* resultArray) noexcept; // Constants static const Vector4 Zero; diff --git a/README.md b/README.md index e50d05a5..f0332b6b 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ For a full change history, see [CHANGELOG.md](https://github.com/microsoft/Direc * clang-format use for this project must match the version use by GitHub Super-Linter to pass the validation. VS 2022 and VS 2026 come with different versions, so to match use: ```cmd -winget install --id=LLVM.LLVM --version 21.1.2 +winget install --id=LLVM.LLVM --version 22.1.3 powershell -File build/Format.ps1 -LLVM ``` diff --git a/Src/EffectCommon.h b/Src/EffectCommon.h index 4d0242e3..9b8609a9 100644 --- a/Src/EffectCommon.h +++ b/Src/EffectCommon.h @@ -111,9 +111,9 @@ namespace DirectX bool lightingEnabled); int SetLightEnabled(int whichLight, - bool value, - _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightDiffuseConstant, - _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightSpecularConstant); + bool value, + _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightDiffuseConstant, + _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightSpecularConstant); int XM_CALLCONV SetLightDiffuseColor(int whichLight, FXMVECTOR value, _Inout_updates_(MaxDirectionalLights) XMVECTOR* lightDiffuseConstant); @@ -152,9 +152,9 @@ namespace DirectX } ID3D11VertexShader* DemandCreateVertexShader(_Inout_ Microsoft::WRL::ComPtr& vertexShader, - ShaderBytecode const& bytecode); + ShaderBytecode const& bytecode); ID3D11PixelShader* DemandCreatePixelShader(_Inout_ Microsoft::WRL::ComPtr& pixelShader, - ShaderBytecode const& bytecode); + ShaderBytecode const& bytecode); ID3D11ShaderResourceView* GetDefaultTexture(); ID3D11ShaderResourceView* GetDefaultNormalTexture(); D3D_FEATURE_LEVEL GetDeviceFeatureLevel() const; diff --git a/Src/GeometricPrimitive.cpp b/Src/GeometricPrimitive.cpp index 2c2c53a5..1dd4cb77 100644 --- a/Src/GeometricPrimitive.cpp +++ b/Src/GeometricPrimitive.cpp @@ -381,7 +381,7 @@ _Use_decl_annotations_ void GeometricPrimitive::CreateInputLayout(IEffect* effec //-------------------------------------------------------------------------------------- _Use_decl_annotations_ std::unique_ptr - GeometricPrimitive::CreateCube(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) +GeometricPrimitive::CreateCube(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) { VertexCollection vertices; IndexCollection indices; @@ -402,7 +402,7 @@ void GeometricPrimitive::CreateCube(VertexCollection& vertices, IndexCollection& // Creates a box primitive. _Use_decl_annotations_ std::unique_ptr - GeometricPrimitive::CreateBox(ID3D11DeviceContext* deviceContext, const XMFLOAT3& size, bool rhcoords, bool invertn) +GeometricPrimitive::CreateBox(ID3D11DeviceContext* deviceContext, const XMFLOAT3& size, bool rhcoords, bool invertn) { VertexCollection vertices; IndexCollection indices; @@ -568,7 +568,7 @@ void GeometricPrimitive::CreateTorus(VertexCollection& vertices, //-------------------------------------------------------------------------------------- _Use_decl_annotations_ std::unique_ptr - GeometricPrimitive::CreateTetrahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) +GeometricPrimitive::CreateTetrahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) { VertexCollection vertices; IndexCollection indices; @@ -592,7 +592,7 @@ void GeometricPrimitive::CreateTetrahedron(VertexCollection& vertices, IndexColl //-------------------------------------------------------------------------------------- _Use_decl_annotations_ std::unique_ptr - GeometricPrimitive::CreateOctahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) +GeometricPrimitive::CreateOctahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) { VertexCollection vertices; IndexCollection indices; @@ -616,7 +616,7 @@ void GeometricPrimitive::CreateOctahedron(VertexCollection& vertices, IndexColle //-------------------------------------------------------------------------------------- _Use_decl_annotations_ std::unique_ptr - GeometricPrimitive::CreateDodecahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) +GeometricPrimitive::CreateDodecahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) { VertexCollection vertices; IndexCollection indices; @@ -640,7 +640,7 @@ void GeometricPrimitive::CreateDodecahedron(VertexCollection& vertices, IndexCol //-------------------------------------------------------------------------------------- _Use_decl_annotations_ std::unique_ptr - GeometricPrimitive::CreateIcosahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) +GeometricPrimitive::CreateIcosahedron(ID3D11DeviceContext* deviceContext, float size, bool rhcoords) { VertexCollection vertices; IndexCollection indices; @@ -664,7 +664,7 @@ void GeometricPrimitive::CreateIcosahedron(VertexCollection& vertices, IndexColl //-------------------------------------------------------------------------------------- _Use_decl_annotations_ std::unique_ptr - GeometricPrimitive::CreateTeapot(ID3D11DeviceContext* deviceContext, float size, size_t tessellation, bool rhcoords) +GeometricPrimitive::CreateTeapot(ID3D11DeviceContext* deviceContext, float size, size_t tessellation, bool rhcoords) { VertexCollection vertices; IndexCollection indices; diff --git a/build/Format.ps1 b/build/Format.ps1 index e7f13176..4f26f4f9 100644 --- a/build/Format.ps1 +++ b/build/Format.ps1 @@ -13,7 +13,7 @@ This is use to clang-format the code using the rules in .github\linters\.clang-f The clang-format version must match the version used by GitHub Super-Linter or false positives can be found. You can install this version locally using: -winget install --id=LLVM.LLVM --version 21.1.2 +winget install --id=LLVM.LLVM --version 22.1.3 .PARAMETER Check Runs clang-format without modifying the files in place. @@ -58,7 +58,7 @@ if (-not $clangFormatPath -or -not (Test-Path -LiteralPath $clangFormatPath -Pat } # This has to match the version used by GitHub super-linter or results will not match. -$requiredClangFormatVersion = '21.1.2' +$requiredClangFormatVersion = '22.1.3' $clangFormatVersion = (& $clangFormatPath '--version' 2>&1 | Out-String).Trim() if ($LASTEXITCODE -ne 0) { throw "Unable to determine clang-format version."