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

Gpu driven 3rd stage commit #16368

Closed

Conversation

stanleyljl
Copy link
Contributor

Re: #

Changelog

  • The 3rd stage of gpu driven.

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.

stanleyljl and others added 11 commits October 8, 2023 17:39
* indirect barrier
* fg move

* remove dbg code

* indirect barrier

* remove dbg code

* first meet logic

* fix depth resource residency

* clear first hzb
* fix undefined
…ct buffer (#19)

* fg move

* remove dbg code

* indirect barrier

* remove dbg code

* first meet logic

* fix depth resource residency

* clear first hzb

* fix undefined

* explicit move access

* rg use access

* update rendergraph interface

* fix macro

* revert useResource interface

* compile issue & lint
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -4578,8 +4578,9 @@
          * @zh 全局光照烘焙的配置,以前名称为lightmapSettings
          */
         bakeSettings: __private._cocos_3d_framework_mesh_renderer__ModelBakeSettings;
         protected _mesh: Mesh | null;
+        protected _gpuDrivenEnabled: boolean;
         protected _shadowCastingMode: number;
         protected _shadowReceivingMode: number;
         protected _shadowBias: number;
         protected _shadowNormalBias: number;
@@ -4630,8 +4631,14 @@
          */
         get mesh(): Mesh | null;
         set mesh(val: Mesh | null);
         /**
+         * @en Whether to enable GPU Driven.
+         * @zh 是否开启 GPU Driven 。
+         */
+        get gpuDrivenEnabled(): boolean;
+        set gpuDrivenEnabled(val: boolean);
+        /**
          * @en Gets the model in [[RenderScene]].
          * @zh 获取渲染场景 [[RenderScene]] 中对应的模型。
          */
         get model(): renderer.scene.Model | null;
@@ -4768,8 +4775,9 @@
         protected _updateShadowBias(): void;
         protected _updateShadowNormalBias(): void;
         protected _updateCastShadow(): void;
         protected _updateReceiveShadow(): void;
+        protected _updateGPUDrivenEnabled(): void;
         protected onMobilityChanged(): void;
         protected onLightProbeBakingChanged(): void;
         protected onUseLightProbeChanged(): void;
         protected onReflectionProbeChanged(): void;
@@ -11178,8 +11186,14 @@
                  */
                 get reflectionProbeBlendWeight(): number;
                 set reflectionProbeBlendWeight(val: number);
                 /**
+                 * @en Whether to enable GPU Driven.
+                 * @zh 是否开启 GPU Driven 。
+                 */
+                get gpuDrivenEnabled(): boolean;
+                set gpuDrivenEnabled(val: boolean);
+                /**
                  * @en The type of the model
                  * @zh 模型类型
                  */
                 type: ModelType;
@@ -11329,8 +11343,13 @@
                  * @zh 反射探针类型。
                  */
                 protected _reflectionProbeType: ReflectionProbeType;
                 /**
+                 * @en Whether to enable GPU Driven.
+                 * @zh 是否开启 GPU Driven 。
+                 */
+                protected _gpuDrivenEnabled: boolean;
+                /**
                  * @internal
                  * @en native object
                  * @zh 原生对象
                  */
@@ -13645,14 +13664,8 @@
              * @zh 删除所有模型。
              */
             removeModels(): void;
             /**
-             * Add a mesh to GPUScene.
-             * Only support in native.
-             * @internal
-             */
-            addGPUMesh(m: Mesh): void;
-            /**
              * @en Add a GPU Driven model, all models attached to the render scene will be submitted for rendering.
              * @zh 增加一个 GPU Driven 模型,渲染场景上挂载的所有模型都会被提交渲染。
              * @param m The model.
              */
@@ -35628,16 +35641,17 @@
             targetFirstSlice: number;
             targetPlaneSlice: number;
         }
         export class MovePair {
-            constructor(source?: string, target?: string, mipLevels?: number, numSlices?: number, targetMostDetailedMip?: number, targetFirstSlice?: number, targetPlaneSlice?: number);
+            constructor(source?: string, target?: string, mipLevels?: number, numSlices?: number, targetMostDetailedMip?: number, targetFirstSlice?: number, targetPlaneSlice?: number, possibleUsage?: gfx.AccessFlagBit);
             source: string;
             target: string;
             mipLevels: number;
             numSlices: number;
             targetMostDetailedMip: number;
             targetFirstSlice: number;
             targetPlaneSlice: number;
+            possibleUsage: gfx.AccessFlagBit;
         }
         export class PipelineStatistics {
             numRenderPasses: number;
             numManagedTextures: number;
@@ -36646,9 +36660,9 @@
              * @param camera @en camera of the culling pass @zh 剔除通道的摄像机
              * @param hzbName @en name of hierarchical z buffer @zh 层次深度缓存的名字
              * @param light @en light of the culling pass @zh 剔除通道的灯光
              */
-            addBuiltinGpuCullingPass(cullingID: number, camera: renderer.scene.Camera, hzbName?: string, light?: renderer.scene.Light | null, bMainPass?: boolean): void;
+            addBuiltinGpuCullingPass(cullingID: number, camera: renderer.scene.Camera, layoutPath?: string, hzbName?: string, light?: renderer.scene.Light | null, level?: number, bMainPass?: boolean): void;
             /**
              * @en Add hierarchical z buffer generation pass
              * @zh 添加层次化深度缓存生成通道
              * @param sourceDepthStencilName @en name of source depth buffer @zh 来源深度缓存名字

@star-e star-e requested a review from bluesky013 October 8, 2023 09:58
@@ -541,7 +542,21 @@ gfx::DescriptorSet* initDescriptorSet(
// render graph textures
auto* texture = resg.getTexture(iter->second);
CC_ENSURES(texture);
newSet->bindTexture(bindID, texture);
gfx::AccessFlags access = gfx::AccessFlagBit::NONE;
Copy link
Contributor

Choose a reason for hiding this comment

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

This might not be the best way to get texture access, for temperary usage it works. I'll give a slolution later.

cocos/rendering/custom/types.ts Show resolved Hide resolved
@minggo minggo closed this Oct 9, 2023
@minggo minggo reopened this Oct 9, 2023
@stanleyljl stanleyljl closed this Oct 9, 2023
@stanleyljl stanleyljl reopened this Oct 9, 2023
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

@stanleyljl ❗ There was an error during the execution of the tasks. Please check the logs for more details.

1 similar comment
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

@stanleyljl ❗ There was an error during the execution of the tasks. Please check the logs for more details.

@stanleyljl stanleyljl closed this Oct 11, 2023
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.

5 participants