Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipeline c++ lint and remove deprecated APIs #17712

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

star-e
Copy link
Contributor

@star-e star-e commented Oct 14, 2024

Remove unnecessary inline, const_cast.
Add IWYU comments.
Remove deprecated APIs in the pipeline interface.

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@star-e star-e changed the title lint pipeline c++ lint Oct 14, 2024
Copy link

github-actions bot commented Oct 14, 2024

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -36070,16 +36070,8 @@
              * @param texture @en readonly texture @zh 只读的贴图
              */
             setTexture(name: string, texture: gfx.Texture): void;
             /**
-             * @deprecated Method will be removed in the future
-             */
-            setReadWriteBuffer(name: string, buffer: gfx.Buffer): void;
-            /**
-             * @deprecated Method will be removed in the future
-             */
-            setReadWriteTexture(name: string, texture: gfx.Texture): void;
-            /**
              * @en Set sampler descriptor.
              * Type of the sampler should match the one in shader.
              * @zh 设置采样器描述符。类型需要与着色器中的一致。
              * 不匹配会引起未定义行为。
@@ -36094,15 +36086,8 @@
              * @param camera @en The camera instance to be set. @zh 当前相机
              */
             setBuiltinCameraConstants(camera: renderer.scene.Camera): void;
             /**
-             * @deprecated Method will be removed in the future
-             * @en Same as setBuiltinDirectionalLightConstants
-             * @zh 同setBuiltinDirectionalLightConstants
-             * @param light @en The main light. @zh 主光
-             */
-            setBuiltinShadowMapConstants(light: renderer.scene.DirectionalLight): void;
-            /**
              * @en Set builtin directional light and shadow constants.
              * For list of constants, please check CCShadow in cc-shadow.chunk and CCCamera in cc-global.chunk.
              * @zh 设置内置方向光与阴影常量。
              * 具体常量见cc-shadow.chunk中的CCShadow与cc-global.chunk中的CCCamera。

@star-e star-e requested a review from minggo October 15, 2024 05:55
#pragma once
#include "cocos/base/std/variant.h"
// clang-format off
// IWYU pragma: begin_exports
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all compilers support IWYU pragma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall I remove them? If vscode is used and clang-tidy is enabled with latest llvm, it will show warnings in the IDE.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can i know what's the warning message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Included header RenderGraphFwd.h is not used directly (fix available)clangd[unused-includes](https://clangd.llvm.org/guides/include-cleaner) like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good feature. So this modification just avoid exporting the following forward declaration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CustomFwd.h depends on RenderGraphFwd.h.

If user included CustomFwd.h, generally user will also include RenderGraphFwd.h.

So RenderGraphFwd.h is included in CustomFwd.h to export dependent symbols.

However, since no symbol in RenderGraphFwd.h is used in CustomFwd.h, clangd treats it as a warning.

IWYU pragma: begin_exports is added to specify RenderGraphFwd.h as export. The warning is disabled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I think keep it is no problem as it just fix warnings.

@star-e star-e changed the title pipeline c++ lint pipeline c++ lint and remove deprecated APIs Oct 15, 2024
@star-e star-e merged commit 9652521 into cocos:v3.8.5 Oct 15, 2024
25 checks passed
@star-e star-e deleted the v3.8.5-pipeline branch October 15, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants