From e52bb2bf069c1c557f5d55e276f935a9e1f89656 Mon Sep 17 00:00:00 2001 From: mmyduckx <308303735@qq.com> Date: Mon, 14 Feb 2022 09:31:00 +0800 Subject: [PATCH] add forward declaration for pipeline (#10082) --- native/cocos/core/Root.cpp | 1 + native/cocos/core/assets/Material.cpp | 6 ++- native/cocos/core/assets/Material.h | 2 +- .../cocos/core/scene-graph/SceneGlobals.cpp | 1 + native/cocos/renderer/core/PassUtils.cpp | 9 +--- native/cocos/renderer/core/PassUtils.h | 7 +-- native/cocos/renderer/core/ProgramLib.cpp | 2 + native/cocos/renderer/core/ProgramLib.h | 1 + .../cocos/renderer/pipeline/BatchedBuffer.cpp | 3 ++ .../cocos/renderer/pipeline/BatchedBuffer.h | 8 +-- .../renderer/pipeline/ClusterLightCulling.cpp | 5 ++ .../renderer/pipeline/ClusterLightCulling.h | 3 +- native/cocos/renderer/pipeline/Define.cpp | 1 + native/cocos/renderer/pipeline/Define.h | 3 +- .../renderer/pipeline/GeometryRenderer.cpp | 54 ++++++++++--------- .../renderer/pipeline/GeometryRenderer.h | 1 - .../cocos/renderer/pipeline/InstancedBuffer.h | 1 - .../renderer/pipeline/PipelineSceneData.cpp | 5 +- .../renderer/pipeline/PipelineSceneData.h | 5 +- .../pipeline/PipelineStateManager.cpp | 1 + .../renderer/pipeline/PipelineStateManager.h | 5 +- .../cocos/renderer/pipeline/PipelineUBO.cpp | 12 +++-- native/cocos/renderer/pipeline/PipelineUBO.h | 9 ++-- .../renderer/pipeline/PlanarShadowQueue.cpp | 6 ++- .../renderer/pipeline/PlanarShadowQueue.h | 6 ++- .../pipeline/RenderAdditiveLightQueue.cpp | 15 ++++-- .../pipeline/RenderAdditiveLightQueue.h | 11 ++-- .../renderer/pipeline/RenderBatchedQueue.cpp | 1 + native/cocos/renderer/pipeline/RenderFlow.cpp | 2 + native/cocos/renderer/pipeline/RenderFlow.h | 6 ++- .../renderer/pipeline/RenderPipeline.cpp | 12 +++-- .../cocos/renderer/pipeline/RenderPipeline.h | 10 ++-- .../cocos/renderer/pipeline/RenderQueue.cpp | 2 + native/cocos/renderer/pipeline/RenderStage.h | 5 +- .../cocos/renderer/pipeline/SceneCulling.cpp | 37 +++++++------ native/cocos/renderer/pipeline/SceneCulling.h | 8 +-- .../pipeline/ShadowMapBatchedQueue.cpp | 4 ++ .../renderer/pipeline/ShadowMapBatchedQueue.h | 12 ++--- native/cocos/renderer/pipeline/UIPhase.cpp | 3 ++ native/cocos/renderer/pipeline/UIPhase.h | 11 +++- .../renderer/pipeline/deferred/BloomStage.cpp | 3 ++ .../renderer/pipeline/deferred/BloomStage.h | 3 +- .../pipeline/deferred/DeferredPipeline.cpp | 6 +++ .../pipeline/deferred/DeferredPipeline.h | 8 ++- .../deferred/DeferredPipelineSceneData.cpp | 4 ++ .../deferred/DeferredPipelineSceneData.h | 7 +-- .../pipeline/deferred/GbufferStage.cpp | 6 +-- .../renderer/pipeline/deferred/GbufferStage.h | 1 - .../pipeline/deferred/LightingStage.cpp | 6 +-- .../pipeline/deferred/PostProcessStage.cpp | 6 ++- .../pipeline/forward/ForwardPipeline.cpp | 3 ++ .../pipeline/forward/ForwardPipeline.h | 2 - .../pipeline/forward/ForwardStage.cpp | 3 ++ .../cocos/renderer/pipeline/helper/Utils.cpp | 1 + .../renderer/pipeline/shadow/ShadowFlow.cpp | 9 ++-- .../renderer/pipeline/shadow/ShadowFlow.h | 3 +- .../renderer/pipeline/shadow/ShadowStage.cpp | 6 +++ .../renderer/pipeline/shadow/ShadowStage.h | 5 +- native/cocos/scene/Ambient.cpp | 1 + native/cocos/scene/DirectionalLight.cpp | 1 + native/cocos/scene/Model.cpp | 2 + native/cocos/scene/Model.h | 2 +- native/cocos/scene/RenderScene.cpp | 1 + native/cocos/scene/Skybox.cpp | 3 +- native/cocos/scene/SphereLight.cpp | 2 +- native/cocos/scene/SpotLight.cpp | 1 + native/cocos/scene/SubModel.cpp | 3 +- 67 files changed, 237 insertions(+), 157 deletions(-) diff --git a/native/cocos/core/Root.cpp b/native/cocos/core/Root.cpp index c70af372b6..09fd6601c0 100644 --- a/native/cocos/core/Root.cpp +++ b/native/cocos/core/Root.cpp @@ -30,6 +30,7 @@ #include "renderer/gfx-base/GFXDef.h" #include "renderer/gfx-base/GFXDevice.h" #include "renderer/gfx-base/GFXSwapchain.h" +#include "renderer/pipeline/PipelineSceneData.h" #include "renderer/pipeline/deferred/DeferredPipeline.h" #include "renderer/pipeline/forward/ForwardPipeline.h" #include "scene/Camera.h" diff --git a/native/cocos/core/assets/Material.cpp b/native/cocos/core/assets/Material.cpp index d6ebdb8701..83eb4aaebe 100644 --- a/native/cocos/core/assets/Material.cpp +++ b/native/cocos/core/assets/Material.cpp @@ -54,6 +54,8 @@ Material::Material() { _passes = std::make_shared>>(); } +Material::~Material() = default; + void Material::initialize(const IMaterialInfo &info) { // cjh FIXME: remove hacking code here if (!BuiltinResMgr::getInstance()->isInitialized()) { @@ -401,9 +403,9 @@ void Material::bindTexture(scene::Pass *pass, uint32_t handle, const MaterialPro } const uint32_t binding = scene::Pass::getBindingFromHandle(handle); - if (const auto *pTexture = cc::get_if>(&val)) { + if (const auto *pTexture = cc::get_if>(&val)) { pass->bindTexture(binding, const_cast(pTexture->get()), index); - } else if (const auto *pTextureBase = cc::get_if>(&val)) { + } else if (const auto *pTextureBase = cc::get_if>(&val)) { auto * textureBase = pTextureBase->get(); gfx::Texture *texture = nullptr; if (textureBase != nullptr) { diff --git a/native/cocos/core/assets/Material.h b/native/cocos/core/assets/Material.h index 7754082dc1..e2bef7f521 100644 --- a/native/cocos/core/assets/Material.h +++ b/native/cocos/core/assets/Material.h @@ -101,7 +101,7 @@ public: } Material(); - ~Material() override = default; + ~Material() override; /** * @en Initialize this material with the given information. diff --git a/native/cocos/core/scene-graph/SceneGlobals.cpp b/native/cocos/core/scene-graph/SceneGlobals.cpp index e8b6040049..17b8770c77 100644 --- a/native/cocos/core/scene-graph/SceneGlobals.cpp +++ b/native/cocos/core/scene-graph/SceneGlobals.cpp @@ -25,6 +25,7 @@ #include "core/scene-graph/SceneGlobals.h" #include "core/Root.h" +#include "renderer/pipeline/PipelineSceneData.h" #include "scene/Ambient.h" #include "scene/Fog.h" #include "scene/Octree.h" diff --git a/native/cocos/renderer/core/PassUtils.cpp b/native/cocos/renderer/core/PassUtils.cpp index 84e0e68aae..7fc77699ec 100644 --- a/native/cocos/renderer/core/PassUtils.cpp +++ b/native/cocos/renderer/core/PassUtils.cpp @@ -27,14 +27,7 @@ #include #include "base/Log.h" #include "core/Types.h" -#include "gfx-base/GFXDef-common.h" -#include "math/Color.h" -#include "math/Mat3.h" -#include "math/Mat4.h" -#include "math/Vec2.h" -#include "math/Vec3.h" -#include "math/Vec4.h" -#include "renderer/gfx-base/GFXDef.h" +#include "core/assets/TextureBase.h" namespace cc { diff --git a/native/cocos/renderer/core/PassUtils.h b/native/cocos/renderer/core/PassUtils.h index 84b620b7b2..f26d6fbeb5 100644 --- a/native/cocos/renderer/core/PassUtils.h +++ b/native/cocos/renderer/core/PassUtils.h @@ -26,10 +26,9 @@ #pragma once #include +#include "base/Ptr.h" #include "base/TypeDef.h" #include "cocos/base/Variant.h" -#include "core/Types.h" -#include "core/assets/TextureBase.h" #include "math/Color.h" #include "math/Mat3.h" @@ -43,6 +42,8 @@ namespace cc { +class TextureBase; + constexpr uint32_t TYPE_MASK = 0xfc000000; // 6 bits => 64 types constexpr uint32_t BINDING_MASK = 0x03f00000; // 6 bits => 64 bindings constexpr uint32_t COUNT_MASK = 0x000ff000; // 8 bits => 256 vectors @@ -71,7 +72,7 @@ using MacroValue = cc::variant; */ using MacroRecord = Record; -using MaterialProperty = cc::variant /*10*/, cc::IntrusivePtr /*11*/>; +using MaterialProperty = cc::variant /*10*/, IntrusivePtr /*11*/>; using MaterialPropertyList = std::vector; diff --git a/native/cocos/renderer/core/ProgramLib.cpp b/native/cocos/renderer/core/ProgramLib.cpp index cf5d5b63a2..ea3707133a 100644 --- a/native/cocos/renderer/core/ProgramLib.cpp +++ b/native/cocos/renderer/core/ProgramLib.cpp @@ -32,6 +32,8 @@ #include "core/assets/EffectAsset.h" #include "renderer/gfx-base/GFXDevice.h" #include "renderer/pipeline/Define.h" +#include "renderer/pipeline/RenderPipeline.h" + namespace cc { namespace { diff --git a/native/cocos/renderer/core/ProgramLib.h b/native/cocos/renderer/core/ProgramLib.h index 7cee69ea93..fa0b4b39e7 100644 --- a/native/cocos/renderer/core/ProgramLib.h +++ b/native/cocos/renderer/core/ProgramLib.h @@ -34,6 +34,7 @@ #include "base/Vector.h" #include "cocos/base/Optional.h" #include "core/Types.h" +#include "core/assets/EffectAsset.h" #include "renderer/gfx-base/GFXDef-common.h" #include "renderer/pipeline/Define.h" #include "renderer/pipeline/RenderPipeline.h" diff --git a/native/cocos/renderer/pipeline/BatchedBuffer.cpp b/native/cocos/renderer/pipeline/BatchedBuffer.cpp index 5c30dadab7..033a3a766a 100644 --- a/native/cocos/renderer/pipeline/BatchedBuffer.cpp +++ b/native/cocos/renderer/pipeline/BatchedBuffer.cpp @@ -28,6 +28,9 @@ #include "gfx-base/GFXDescriptorSet.h" #include "gfx-base/GFXDevice.h" #include "gfx-base/GFXInputAssembler.h" +#include "scene/Model.h" +#include "scene/Pass.h" +#include "scene/SubModel.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/BatchedBuffer.h b/native/cocos/renderer/pipeline/BatchedBuffer.h index 9c0791eeb7..82ab609628 100644 --- a/native/cocos/renderer/pipeline/BatchedBuffer.h +++ b/native/cocos/renderer/pipeline/BatchedBuffer.h @@ -27,11 +27,13 @@ #include #include "Define.h" -#include "scene/Model.h" -#include "scene/Pass.h" -#include "scene/SubModel.h" namespace cc { +namespace scene { +class Pass; +class Model; +class SubModel; +} // namespace scene namespace pipeline { struct CC_DLL BatchedItem { diff --git a/native/cocos/renderer/pipeline/ClusterLightCulling.cpp b/native/cocos/renderer/pipeline/ClusterLightCulling.cpp index 61a1b9dfca..35616f8469 100644 --- a/native/cocos/renderer/pipeline/ClusterLightCulling.cpp +++ b/native/cocos/renderer/pipeline/ClusterLightCulling.cpp @@ -25,8 +25,13 @@ #include "ClusterLightCulling.h" #include "Define.h" +#include "PipelineSceneData.h" +#include "PipelineUBO.h" +#include "cocos/renderer/gfx-base/GFXDevice.h" +#include "cocos/renderer/pipeline/RenderPipeline.h" #include "deferred/DeferredPipeline.h" #include "frame-graph/FrameGraph.h" +#include "scene/Camera.h" #include "scene/SphereLight.h" #include "scene/SpotLight.h" diff --git a/native/cocos/renderer/pipeline/ClusterLightCulling.h b/native/cocos/renderer/pipeline/ClusterLightCulling.h index c531cd488a..5c8646f401 100644 --- a/native/cocos/renderer/pipeline/ClusterLightCulling.h +++ b/native/cocos/renderer/pipeline/ClusterLightCulling.h @@ -26,13 +26,12 @@ #pragma once #include "cocos/renderer/gfx-base/GFXDef.h" -#include "cocos/renderer/gfx-base/GFXDevice.h" -#include "cocos/renderer/pipeline/RenderPipeline.h" #include "cocos/scene/Pass.h" #include "cocos/scene/RenderScene.h" namespace cc { namespace pipeline { +class RenderPipeline; struct ShaderStrings { String glsl4; String glsl3; diff --git a/native/cocos/renderer/pipeline/Define.cpp b/native/cocos/renderer/pipeline/Define.cpp index 36995a9370..c8492bd4a3 100644 --- a/native/cocos/renderer/pipeline/Define.cpp +++ b/native/cocos/renderer/pipeline/Define.cpp @@ -26,6 +26,7 @@ #include "Define.h" #include "bindings/jswrapper/SeApi.h" #include "gfx-base/GFXDevice.h" +#include "scene/Light.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/Define.h b/native/cocos/renderer/pipeline/Define.h index a06bdf1d4f..72400693e9 100644 --- a/native/cocos/renderer/pipeline/Define.h +++ b/native/cocos/renderer/pipeline/Define.h @@ -30,15 +30,14 @@ #include "base/Object.h" #include "base/TypeDef.h" #include "base/Value.h" -#include "gfx-base/GFXDef-common.h" #include "renderer/gfx-base/GFXDef.h" -#include "scene/Light.h" namespace cc { namespace scene { class Model; class SubModel; +class Light; } // namespace scene namespace pipeline { diff --git a/native/cocos/renderer/pipeline/GeometryRenderer.cpp b/native/cocos/renderer/pipeline/GeometryRenderer.cpp index 3daa872b0e..8e97e57a35 100644 --- a/native/cocos/renderer/pipeline/GeometryRenderer.cpp +++ b/native/cocos/renderer/pipeline/GeometryRenderer.cpp @@ -28,6 +28,7 @@ #include #include #include "Define.h" +#include "PipelineSceneData.h" #include "PipelineStateManager.h" #include "RenderPipeline.h" #include "base/Log.h" @@ -35,6 +36,7 @@ #include "core/geometry/Frustum.h" #include "math/Mat4.h" #include "math/Math.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { @@ -458,8 +460,8 @@ void GeometryRenderer::addFrustum(const geometry::Frustum *frustum, gfx::Color c } void GeometryRenderer::addCapsule(const Vec3 ¢er, float radius, float height, gfx::Color color, uint32_t segmentsU, uint32_t hemiSegmentsV, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { - const auto deltaPhi = math::PI_2 / segmentsU; - const auto deltaTheta = math::PI_DIV2 / hemiSegmentsV; + const auto deltaPhi = math::PI_2 / static_cast(segmentsU); + const auto deltaTheta = math::PI_DIV2 / static_cast(hemiSegmentsV); Vec3 bottomCenter{center.x, center.y - height / 2.0F, center.z}; Vec3 topCenter{center.x, center.y + height / 2.0F, center.z}; @@ -471,12 +473,12 @@ void GeometryRenderer::addCapsule(const Vec3 ¢er, float radius, float height CircleList bottomList; CircleList topList; - float theta = i * deltaTheta; + float theta = static_cast(i) * deltaTheta; float sinTheta = sinf(theta); float cosTheta = cosf(theta); for (auto j = 0U; j < segmentsU + 1; j++) { - float phi = j * deltaPhi; + float phi = static_cast(j) * deltaPhi; float sinPhi = sinf(phi); float cosPhi = cosf(phi); Vec3 p{radius * sinTheta * cosPhi, radius * cosTheta, radius * sinTheta * sinPhi}; @@ -517,14 +519,14 @@ void GeometryRenderer::addCapsule(const Vec3 ¢er, float radius, float height } void GeometryRenderer::addCylinder(const Vec3 ¢er, float radius, float height, gfx::Color color, uint32_t segments, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { - const auto deltaPhi = math::PI_2 / segments; + const auto deltaPhi = math::PI_2 / static_cast(segments); Vec3 bottomCenter{center.x, center.y - height / 2.0F, center.z}; Vec3 topCenter{center.x, center.y + height / 2.0F, center.z}; std::vector bottomPoints; std::vector topPoints; for (auto i = 0U; i < segments + 1; i++) { - float phi = i * deltaPhi; + float phi = static_cast(i) * deltaPhi; Vec3 p{radius * cosf(phi), 0.0F, radius * sinf(phi)}; bottomPoints.emplace_back(p + bottomCenter); topPoints.emplace_back(p + topCenter); @@ -550,13 +552,13 @@ void GeometryRenderer::addCylinder(const Vec3 ¢er, float radius, float heigh } void GeometryRenderer::addCone(const Vec3 ¢er, float radius, float height, gfx::Color color, uint32_t segments, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { - const auto deltaPhi = math::PI_2 / segments; + const auto deltaPhi = math::PI_2 / static_cast(segments); Vec3 bottomCenter{center.x, center.y - height / 2.0F, center.z}; Vec3 topCenter{center.x, center.y + height / 2.0F, center.z}; std::vector bottomPoints; for (auto i = 0U; i < segments + 1; i++) { - Vec3 point{radius * cosf(i * deltaPhi), 0.0F, radius * sinf(i * deltaPhi)}; + Vec3 point{radius * cosf(static_cast(i) * deltaPhi), 0.0F, radius * sinf(static_cast(i) * deltaPhi)}; bottomPoints.emplace_back(point + bottomCenter); } @@ -576,11 +578,11 @@ void GeometryRenderer::addCone(const Vec3 ¢er, float radius, float height, g } void GeometryRenderer::addCircle(const Vec3 ¢er, float radius, gfx::Color color, uint32_t segments, bool depthTest, bool useTransform, const Mat4 &transform) { - const auto deltaPhi = math::PI_2 / segments; + const auto deltaPhi = math::PI_2 / static_cast(segments); std::vector points; for (auto i = 0U; i < segments + 1; i++) { - Vec3 point{radius * cosf(i * deltaPhi), 0.0F, radius * sinf(i * deltaPhi)}; + Vec3 point{radius * cosf(static_cast(i) * deltaPhi), 0.0F, radius * sinf(static_cast(i) * deltaPhi)}; points.emplace_back(point + center); } @@ -598,11 +600,11 @@ void GeometryRenderer::addCircle(const Vec3 ¢er, float radius, gfx::Color co void GeometryRenderer::addArc(const Vec3 ¢er, float radius, gfx::Color color, float startAngle, float endAngle, uint32_t segments, bool depthTest, bool useTransform, const Mat4 &transform) { float startRadian = math::DEG_TO_RAD * startAngle; float endRadian = math::DEG_TO_RAD * endAngle; - const auto deltaPhi = (endRadian - startRadian) / segments; + const auto deltaPhi = (endRadian - startRadian) / static_cast(segments); std::vector points; for (auto i = 0U; i < segments + 1; i++) { - Vec3 point{radius * cosf(i * deltaPhi + startRadian), 0.0F, radius * sinf(i * deltaPhi + startRadian)}; + Vec3 point{radius * cosf(static_cast(i) * deltaPhi + startRadian), 0.0F, radius * sinf(static_cast(i) * deltaPhi + startRadian)}; points.emplace_back(point + center); } @@ -626,12 +628,12 @@ void GeometryRenderer::addPolygon(const Vec3 ¢er, float radius, gfx::Color c } void GeometryRenderer::addDisc(const Vec3 ¢er, float radius, gfx::Color color, uint32_t segments, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { - const auto deltaPhi = math::PI_2 / segments; + const auto deltaPhi = math::PI_2 / static_cast(segments); std::vector points; Vec3 newCenter = center; for (auto i = 0U; i < segments + 1; i++) { - Vec3 point{radius * cosf(i * deltaPhi), 0.0F, radius * sinf(i * deltaPhi)}; + Vec3 point{radius * cosf(static_cast(i) * deltaPhi), 0.0F, radius * sinf(static_cast(i) * deltaPhi)}; points.emplace_back(point + newCenter); } @@ -658,12 +660,12 @@ void GeometryRenderer::addDisc(const Vec3 ¢er, float radius, gfx::Color colo void GeometryRenderer::addSector(const Vec3 ¢er, float radius, gfx::Color color, float startAngle, float endAngle, uint32_t segments, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { float startRadian = math::DEG_TO_RAD * startAngle; float endRadian = math::DEG_TO_RAD * endAngle; - const auto deltaPhi = (endRadian - startRadian) / segments; + const auto deltaPhi = (endRadian - startRadian) / static_cast(segments); std::vector points; Vec3 newCenter = center; for (auto i = 0U; i < segments + 1; i++) { - Vec3 point{radius * cosf(i * deltaPhi), 0.0F, radius * sinf(i * deltaPhi)}; + Vec3 point{radius * cosf(static_cast(i) * deltaPhi), 0.0F, radius * sinf(static_cast(i) * deltaPhi)}; points.emplace_back(point + newCenter); } @@ -688,20 +690,20 @@ void GeometryRenderer::addSector(const Vec3 ¢er, float radius, gfx::Color co } void GeometryRenderer::addSphere(const Vec3 ¢er, float radius, gfx::Color color, uint32_t segmentsU, uint32_t segmentsV, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { - const auto deltaPhi = math::PI_2 / segmentsU; - const auto deltaTheta = math::PI / segmentsV; + const auto deltaPhi = math::PI_2 / static_cast(segmentsU); + const auto deltaTheta = math::PI / static_cast(segmentsV); using CircleList = std::vector; std::vector points; for (auto i = 0U; i < segmentsV + 1; i++) { CircleList list; - float theta = i * deltaTheta; + float theta = static_cast(i) * deltaTheta; float sinTheta = sinf(theta); float cosTheta = cosf(theta); for (auto j = 0U; j < segmentsU + 1; j++) { - float phi = j * deltaPhi; + float phi = static_cast(j) * deltaPhi; float sinPhi = sinf(phi); float cosPhi = cosf(phi); Vec3 p{radius * sinTheta * cosPhi, radius * cosTheta, radius * sinTheta * sinPhi}; @@ -729,20 +731,20 @@ void GeometryRenderer::addSphere(const Vec3 ¢er, float radius, gfx::Color co } void GeometryRenderer::addTorus(const Vec3 ¢er, float bigRadius, float radius, gfx::Color color, uint32_t segmentsU, uint32_t segmentsV, bool wireframe, bool depthTest, bool unlit, bool useTransform, const Mat4 &transform) { - const auto deltaPhi = math::PI_2 / segmentsU; - const auto deltaTheta = math::PI_2 / segmentsV; + const auto deltaPhi = math::PI_2 / static_cast(segmentsU); + const auto deltaTheta = math::PI_2 / static_cast(segmentsV); using CircleList = std::vector; std::vector points; for (auto i = 0U; i < segmentsU + 1; i++) { CircleList list; - float phi = i * deltaPhi; + float phi = static_cast(i) * deltaPhi; float sinPhi = sinf(phi); float cosPhi = cosf(phi); for (auto j = 0U; j < segmentsV + 1; j++) { - float theta = j * deltaTheta; + float theta = static_cast(j) * deltaTheta; float sinTheta = sinf(theta); float cosTheta = cosf(theta); Vec3 p{(bigRadius + radius * cosTheta) * cosPhi, radius * sinTheta, (bigRadius + radius * cosTheta) * sinPhi}; @@ -813,7 +815,7 @@ void GeometryRenderer::addOctahedron(const Vec3 ¢er, float radius, gfx::Colo } void GeometryRenderer::addBezier(const Vec3 &v0, const Vec3 &v1, const Vec3 &v2, const Vec3 &v3, gfx::Color color, uint32_t segments, bool depthTest, bool useTransform, const Mat4 &transform) { - const auto deltaT = 1.0F / segments; + const auto deltaT = 1.0F / static_cast(segments); std::vector points; Vec3 newV0 = v0; @@ -829,7 +831,7 @@ void GeometryRenderer::addBezier(const Vec3 &v0, const Vec3 &v1, const Vec3 &v2, } for (auto i = 0U; i < segments + 1; i++) { - float t = i * deltaT; + float t = static_cast(i) * deltaT; float a = (1.0F - t) * (1.0F - t) * (1.0F - t); float b = 3.0F * t * (1.0F - t) * (1.0F - t); float c = 3.0F * t * t * (1.0F - t); diff --git a/native/cocos/renderer/pipeline/GeometryRenderer.h b/native/cocos/renderer/pipeline/GeometryRenderer.h index 068490fcc1..44b12b66e7 100644 --- a/native/cocos/renderer/pipeline/GeometryRenderer.h +++ b/native/cocos/renderer/pipeline/GeometryRenderer.h @@ -29,7 +29,6 @@ #include "base/Macros.h" #include "base/RefCounted.h" #include "gfx-base/GFXDef-common.h" -#include "gfx-base/GFXDevice.h" #include "math/Vec2.h" #include "math/Vec3.h" #include "math/Vec4.h" diff --git a/native/cocos/renderer/pipeline/InstancedBuffer.h b/native/cocos/renderer/pipeline/InstancedBuffer.h index f86c97f353..f2aa0ac38f 100644 --- a/native/cocos/renderer/pipeline/InstancedBuffer.h +++ b/native/cocos/renderer/pipeline/InstancedBuffer.h @@ -28,7 +28,6 @@ #include "Define.h" #include "scene/Model.h" #include "scene/Pass.h" -#include "scene/SubModel.h" namespace cc { namespace gfx { diff --git a/native/cocos/renderer/pipeline/PipelineSceneData.cpp b/native/cocos/renderer/pipeline/PipelineSceneData.cpp index b2f1f3e8b2..3d1f283443 100644 --- a/native/cocos/renderer/pipeline/PipelineSceneData.cpp +++ b/native/cocos/renderer/pipeline/PipelineSceneData.cpp @@ -24,18 +24,19 @@ ****************************************************************************/ #include "PipelineSceneData.h" +#include #include "core/ArrayBuffer.h" +#include "core/assets/Material.h" #include "gfx-base/GFXDef-common.h" #include "gfx-base/GFXDevice.h" #include "gfx-base/GFXFramebuffer.h" #include "scene/Ambient.h" #include "scene/Fog.h" #include "scene/Octree.h" +#include "scene/Pass.h" #include "scene/Shadow.h" #include "scene/Skybox.h" -#include - namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/PipelineSceneData.h b/native/cocos/renderer/pipeline/PipelineSceneData.h index e5c7c039ac..ce0b000f20 100644 --- a/native/cocos/renderer/pipeline/PipelineSceneData.h +++ b/native/cocos/renderer/pipeline/PipelineSceneData.h @@ -28,9 +28,6 @@ #include "Define.h" #include "core/assets/Material.h" #include "core/geometry/Sphere.h" -#include "gfx-base/GFXBuffer.h" -#include "scene/Light.h" -#include "scene/Pass.h" namespace cc { @@ -38,11 +35,13 @@ namespace gfx { class Framebuffer; } namespace scene { +class Pass; class Ambient; class Shadows; class Skybox; class Fog; class Octree; +class Light; } // namespace scene namespace pipeline { diff --git a/native/cocos/renderer/pipeline/PipelineStateManager.cpp b/native/cocos/renderer/pipeline/PipelineStateManager.cpp index 54b4b85cff..bc1cc34bd5 100644 --- a/native/cocos/renderer/pipeline/PipelineStateManager.cpp +++ b/native/cocos/renderer/pipeline/PipelineStateManager.cpp @@ -26,6 +26,7 @@ #include "PipelineStateManager.h" #include "gfx-base/GFXDef-common.h" #include "gfx-base/GFXDevice.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/PipelineStateManager.h b/native/cocos/renderer/pipeline/PipelineStateManager.h index 7053857e8c..48368c2c68 100644 --- a/native/cocos/renderer/pipeline/PipelineStateManager.h +++ b/native/cocos/renderer/pipeline/PipelineStateManager.h @@ -25,10 +25,13 @@ #pragma once +#include "cocos/base/Ptr.h" #include "gfx-base/GFXDef.h" -#include "scene/Pass.h" namespace cc { +namespace scene { +class Pass; +} namespace pipeline { class CC_DLL PipelineStateManager { diff --git a/native/cocos/renderer/pipeline/PipelineUBO.cpp b/native/cocos/renderer/pipeline/PipelineUBO.cpp index cd9ee08c0d..7e44d13380 100644 --- a/native/cocos/renderer/pipeline/PipelineUBO.cpp +++ b/native/cocos/renderer/pipeline/PipelineUBO.cpp @@ -24,15 +24,19 @@ ****************************************************************************/ #include "PipelineUBO.h" +#include "GlobalDescriptorSetManager.h" +#include "PipelineSceneData.h" #include "RenderPipeline.h" #include "SceneCulling.h" #include "application/ApplicationManager.h" #include "core/Root.h" #include "forward/ForwardPipeline.h" #include "gfx-base/GFXDevice.h" +#include "scene/Camera.h" #include "scene/DirectionalLight.h" #include "scene/Fog.h" #include "scene/RenderScene.h" +#include "scene/Shadow.h" #include "scene/SpotLight.h" namespace cc { @@ -178,10 +182,10 @@ void PipelineUBO::updateCameraUBOView(const RenderPipeline *pipeline, float *out output[UBOCamera::GLOBAL_NEAR_FAR_OFFSET + 0] = static_cast(camera->getNearClip()); output[UBOCamera::GLOBAL_NEAR_FAR_OFFSET + 1] = static_cast(camera->getFarClip()); - output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 0] = sceneData->getShadingScale() * camera->getWindow()->getWidth() * camera->getViewport().x; - output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 1] = sceneData->getShadingScale() * camera->getWindow()->getHeight() * camera->getViewport().y; - output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 2] = sceneData->getShadingScale() * camera->getWindow()->getWidth() * camera->getViewport().z; - output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 3] = sceneData->getShadingScale() * camera->getWindow()->getHeight() * camera->getViewport().w; + output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 0] = sceneData->getShadingScale() * static_cast(camera->getWindow()->getWidth()) * camera->getViewport().x; + output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 1] = sceneData->getShadingScale() * static_cast(camera->getWindow()->getHeight()) * camera->getViewport().y; + output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 2] = sceneData->getShadingScale() * static_cast(camera->getWindow()->getWidth()) * camera->getViewport().z; + output[UBOCamera::GLOBAL_VIEW_PORT_OFFSET + 3] = sceneData->getShadingScale() * static_cast(camera->getWindow()->getHeight()) * camera->getViewport().w; } void PipelineUBO::updateShadowUBOView(const RenderPipeline *pipeline, std::array *bufferView, const scene::Camera *camera) { diff --git a/native/cocos/renderer/pipeline/PipelineUBO.h b/native/cocos/renderer/pipeline/PipelineUBO.h index 489da6ee49..a9296d4b0f 100644 --- a/native/cocos/renderer/pipeline/PipelineUBO.h +++ b/native/cocos/renderer/pipeline/PipelineUBO.h @@ -27,17 +27,14 @@ #include #include "Define.h" -#include "scene/Camera.h" -#include "scene/Light.h" namespace cc { - class Mat4; - +namespace scene { +class Camera; +} namespace pipeline { - class RenderPipeline; - class CC_DLL PipelineUBO : public Object { public: static void updateGlobalUBOView(const scene::Camera *camera, std::array *bufferView); diff --git a/native/cocos/renderer/pipeline/PlanarShadowQueue.cpp b/native/cocos/renderer/pipeline/PlanarShadowQueue.cpp index ed709f3311..f8141e1d06 100644 --- a/native/cocos/renderer/pipeline/PlanarShadowQueue.cpp +++ b/native/cocos/renderer/pipeline/PlanarShadowQueue.cpp @@ -27,14 +27,14 @@ #include "Define.h" #include "InstancedBuffer.h" +#include "PipelineSceneData.h" #include "PipelineStateManager.h" #include "PlanarShadowQueue.h" #include "RenderInstancedQueue.h" #include "RenderPipeline.h" #include "core/geometry/AABB.h" -#include "gfx-base/GFXCommandBuffer.h" #include "gfx-base/GFXDevice.h" -#include "gfx-base/GFXShader.h" +#include "scene/Camera.h" #include "scene/Model.h" #include "scene/RenderScene.h" #include "scene/Shadow.h" @@ -47,6 +47,8 @@ PlanarShadowQueue::PlanarShadowQueue(RenderPipeline *pipeline) _instancedQueue = CC_NEW(RenderInstancedQueue); } +PlanarShadowQueue::~PlanarShadowQueue() = default; + void PlanarShadowQueue::gatherShadowPasses(scene::Camera *camera, gfx::CommandBuffer *cmdBuffer) { clear(); diff --git a/native/cocos/renderer/pipeline/PlanarShadowQueue.h b/native/cocos/renderer/pipeline/PlanarShadowQueue.h index b3a9f9a7cf..9ef5081391 100644 --- a/native/cocos/renderer/pipeline/PlanarShadowQueue.h +++ b/native/cocos/renderer/pipeline/PlanarShadowQueue.h @@ -25,10 +25,12 @@ #pragma once #include "base/CoreStd.h" -#include "scene/Camera.h" #include "scene/Model.h" namespace cc { +namespace scene { +class Camera; +} namespace gfx { class Device; class RenderPass; @@ -44,7 +46,7 @@ class RenderBatchedQueue; class CC_DLL PlanarShadowQueue : public Object { public: explicit PlanarShadowQueue(RenderPipeline *pipeline); - ~PlanarShadowQueue() override = default; + ~PlanarShadowQueue() override; void clear(); void gatherShadowPasses(scene::Camera *camera, gfx::CommandBuffer *cmdBuffer); diff --git a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp index 654195fafb..bafdcaeec7 100644 --- a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp +++ b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.cpp @@ -26,12 +26,13 @@ #include #include "BatchedBuffer.h" -#include "InstancedBuffer.h" -#include "PipelineStateManager.h" -#include "RenderAdditiveLightQueue.h" - #include "Define.h" #include "GlobalDescriptorSetManager.h" +#include "InstancedBuffer.h" +#include "PipelineSceneData.h" +#include "PipelineStateManager.h" +#include "PipelineUBO.h" +#include "RenderAdditiveLightQueue.h" #include "RenderBatchedQueue.h" #include "RenderInstancedQueue.h" #include "SceneCulling.h" @@ -39,8 +40,14 @@ #include "core/geometry/Sphere.h" #include "forward/ForwardPipeline.h" #include "gfx-base/GFXDevice.h" +#include "scene/Camera.h" #include "scene/DirectionalLight.h" +#include "scene/Light.h" +#include "scene/Pass.h" #include "scene/RenderScene.h" +#include "scene/Shadow.h" +#include "scene/SphereLight.h" +#include "scene/SpotLight.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h index 2629646c0b..f46a017937 100644 --- a/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h +++ b/native/cocos/renderer/pipeline/RenderAdditiveLightQueue.h @@ -27,16 +27,15 @@ #include "Define.h" #include "base/CoreStd.h" -#include "scene/Camera.h" -#include "scene/Light.h" -#include "scene/Pass.h" -#include "scene/SphereLight.h" -#include "scene/SpotLight.h" namespace cc { namespace scene { class Camera; -} +class Pass; +class Light; +class SpotLight; +class SphereLight; +} // namespace scene namespace pipeline { struct RenderObject; class RenderPipeline; diff --git a/native/cocos/renderer/pipeline/RenderBatchedQueue.cpp b/native/cocos/renderer/pipeline/RenderBatchedQueue.cpp index cd978b401f..1ee292e76f 100644 --- a/native/cocos/renderer/pipeline/RenderBatchedQueue.cpp +++ b/native/cocos/renderer/pipeline/RenderBatchedQueue.cpp @@ -29,6 +29,7 @@ #include "gfx-base/GFXCommandBuffer.h" #include "gfx-base/GFXDevice.h" #include "gfx-base/GFXRenderPass.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/RenderFlow.cpp b/native/cocos/renderer/pipeline/RenderFlow.cpp index 7ddb415c8f..df0c60dd6f 100644 --- a/native/cocos/renderer/pipeline/RenderFlow.cpp +++ b/native/cocos/renderer/pipeline/RenderFlow.cpp @@ -29,6 +29,8 @@ namespace cc { namespace pipeline { +RenderFlow::RenderFlow() = default; + RenderFlow::~RenderFlow() = default; bool RenderFlow::initialize(const RenderFlowInfo &info) { diff --git a/native/cocos/renderer/pipeline/RenderFlow.h b/native/cocos/renderer/pipeline/RenderFlow.h index 614be80b2d..c9d3b84af8 100644 --- a/native/cocos/renderer/pipeline/RenderFlow.h +++ b/native/cocos/renderer/pipeline/RenderFlow.h @@ -26,9 +26,11 @@ #pragma once #include "Define.h" -#include "scene/Camera.h" namespace cc { +namespace scene { +class Camera; +} namespace pipeline { class RenderPipeline; @@ -43,7 +45,7 @@ struct CC_DLL RenderFlowInfo { class CC_DLL RenderFlow : public Object { public: - RenderFlow() = default; + RenderFlow(); ~RenderFlow() override; virtual bool initialize(const RenderFlowInfo &info); diff --git a/native/cocos/renderer/pipeline/RenderPipeline.cpp b/native/cocos/renderer/pipeline/RenderPipeline.cpp index 97bcbd5d5b..5e86e915d6 100644 --- a/native/cocos/renderer/pipeline/RenderPipeline.cpp +++ b/native/cocos/renderer/pipeline/RenderPipeline.cpp @@ -23,23 +23,23 @@ THE SOFTWARE. ****************************************************************************/ +#include "RenderPipeline.h" #include #include "BatchedBuffer.h" #include "GeometryRenderer.h" +#include "GlobalDescriptorSetManager.h" #include "InstancedBuffer.h" +#include "PipelineSceneData.h" #include "PipelineStateManager.h" +#include "PipelineUBO.h" #include "RenderFlow.h" #include "RenderPipeline.h" #include "frame-graph/FrameGraph.h" -#include "gfx-base/GFXCommandBuffer.h" -#include "gfx-base/GFXDescriptorSet.h" -#include "gfx-base/GFXDescriptorSetLayout.h" #include "gfx-base/GFXDevice.h" -#include "gfx-base/GFXTexture.h" #include "helper/Utils.h" +#include "scene/Camera.h" #include "scene/Skybox.h" - namespace cc { namespace pipeline { @@ -299,6 +299,8 @@ void RenderPipeline::generateConstantMacros() { _device->hasFeature(gfx::Feature::INPUT_ATTACHMENT_BENEFIT)); } +gfx::DescriptorSetLayout *RenderPipeline::getDescriptorSetLayout() const { return _globalDSManager->getDescriptorSetLayout(); } + RenderStage *RenderPipeline::getRenderstageByName(const String &name) const { for (auto *flow : _flows) { auto *val = flow->getRenderstageByName(name); diff --git a/native/cocos/renderer/pipeline/RenderPipeline.h b/native/cocos/renderer/pipeline/RenderPipeline.h index 67966032d1..8e9d2bab7e 100644 --- a/native/cocos/renderer/pipeline/RenderPipeline.h +++ b/native/cocos/renderer/pipeline/RenderPipeline.h @@ -28,15 +28,11 @@ #include #include #include "Define.h" -#include "GlobalDescriptorSetManager.h" -#include "PipelineSceneData.h" -#include "PipelineUBO.h" #include "base/CoreStd.h" #include "core/assets/Asset.h" #include "frame-graph/FrameGraph.h" #include "frame-graph/Handle.h" #include "renderer/core/PassUtils.h" -#include "scene/Camera.h" #include "scene/Model.h" namespace cc { @@ -46,14 +42,16 @@ class DescriptorSet; class DescriptorSetLayout; } // namespace gfx namespace scene { +class Camera; class SubModel; } // namespace scene namespace pipeline { +class PipelineUBO; +class PipelineSceneData; class GlobalDSManager; class RenderStage; class GeometryRenderer; - struct CC_DLL RenderPipelineInfo { uint tag = 0; RenderFlowList flows; @@ -86,7 +84,7 @@ public: inline void setValue(const String &name, const std::string &value) { _macros[name] = value; } inline GlobalDSManager * getGlobalDSManager() const { return _globalDSManager; } inline gfx::DescriptorSet * getDescriptorSet() const { return _descriptorSet; } - inline gfx::DescriptorSetLayout * getDescriptorSetLayout() const { return _globalDSManager->getDescriptorSetLayout(); } + gfx::DescriptorSetLayout * getDescriptorSetLayout() const; inline PipelineSceneData * getPipelineSceneData() const { return _pipelineSceneData; } inline const gfx::CommandBufferList & getCommandBuffers() const { return _commandBuffers; } inline const gfx::QueryPoolList & getQueryPools() const { return _queryPools; } diff --git a/native/cocos/renderer/pipeline/RenderQueue.cpp b/native/cocos/renderer/pipeline/RenderQueue.cpp index 33ce19e884..a61e0b2258 100644 --- a/native/cocos/renderer/pipeline/RenderQueue.cpp +++ b/native/cocos/renderer/pipeline/RenderQueue.cpp @@ -26,6 +26,7 @@ #include "RenderQueue.h" #include +#include "PipelineSceneData.h" #include "PipelineStateManager.h" #include "RenderPipeline.h" #include "gfx-base/GFXCommandBuffer.h" @@ -33,6 +34,7 @@ #include "gfx-base/GFXShader.h" #include "scene/Model.h" #include "scene/SubModel.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/RenderStage.h b/native/cocos/renderer/pipeline/RenderStage.h index 6df6a19b80..4d23bc3b9d 100644 --- a/native/cocos/renderer/pipeline/RenderStage.h +++ b/native/cocos/renderer/pipeline/RenderStage.h @@ -26,10 +26,11 @@ #pragma once #include "Define.h" -#include "scene/Camera.h" namespace cc { - +namespace scene { +class Camera; +} namespace gfx { class Framebuffer; } // namespace gfx diff --git a/native/cocos/renderer/pipeline/SceneCulling.cpp b/native/cocos/renderer/pipeline/SceneCulling.cpp index 5649d271c3..6bc7bbe2bb 100644 --- a/native/cocos/renderer/pipeline/SceneCulling.cpp +++ b/native/cocos/renderer/pipeline/SceneCulling.cpp @@ -27,6 +27,7 @@ #include #include "Define.h" +#include "PipelineSceneData.h" #include "RenderPipeline.h" #include "SceneCulling.h" #include "core/geometry/AABB.h" @@ -35,10 +36,12 @@ #include "core/scene-graph/Node.h" #include "gfx-base/GFXDevice.h" #include "math/Quaternion.h" +#include "scene/Camera.h" #include "scene/DirectionalLight.h" #include "scene/Light.h" #include "scene/Octree.h" #include "scene/RenderScene.h" +#include "scene/Shadow.h" #include "scene/Skybox.h" #include "scene/SpotLight.h" @@ -122,23 +125,23 @@ void updateDirLight(scene::Shadows *shadows, const scene::Light *light, std::arr const auto nx = normal.x; const auto ny = normal.y; const auto nz = normal.z; - auto &matLight = shadows->getMatLight(); - matLight.m[0] = 1 - nx * lx; - matLight.m[1] = -nx * ly; - matLight.m[2] = -nx * lz; - matLight.m[3] = 0; - matLight.m[4] = -ny * lx; - matLight.m[5] = 1 - ny * ly; - matLight.m[6] = -ny * lz; - matLight.m[7] = 0; - matLight.m[8] = -nz * lx; - matLight.m[9] = -nz * ly; - matLight.m[10] = 1 - nz * lz; - matLight.m[11] = 0; - matLight.m[12] = lx * distance; - matLight.m[13] = ly * distance; - matLight.m[14] = lz * distance; - matLight.m[15] = 1; + auto & matLight = shadows->getMatLight(); + matLight.m[0] = 1 - nx * lx; + matLight.m[1] = -nx * ly; + matLight.m[2] = -nx * lz; + matLight.m[3] = 0; + matLight.m[4] = -ny * lx; + matLight.m[5] = 1 - ny * ly; + matLight.m[6] = -ny * lz; + matLight.m[7] = 0; + matLight.m[8] = -nz * lx; + matLight.m[9] = -nz * ly; + matLight.m[10] = 1 - nz * lz; + matLight.m[11] = 0; + matLight.m[12] = lx * distance; + matLight.m[13] = ly * distance; + matLight.m[14] = lz * distance; + matLight.m[15] = 1; memcpy(shadowUBO->data() + UBOShadow::MAT_LIGHT_PLANE_PROJ_OFFSET, matLight.m, sizeof(matLight)); memcpy(shadowUBO->data() + UBOShadow::SHADOW_COLOR_OFFSET, shadows->getShadowColor4f().data(), sizeof(float) * 4); diff --git a/native/cocos/renderer/pipeline/SceneCulling.h b/native/cocos/renderer/pipeline/SceneCulling.h index cb05831b5a..867dcb606a 100644 --- a/native/cocos/renderer/pipeline/SceneCulling.h +++ b/native/cocos/renderer/pipeline/SceneCulling.h @@ -28,15 +28,17 @@ #include "core/geometry/Frustum.h" #include "core/geometry/Sphere.h" #include "pipeline/Define.h" -#include "scene/Camera.h" #include "scene/Define.h" -#include "scene/Light.h" -#include "scene/Shadow.h" namespace cc { class Mat4; class Vec4; class Vec3; +namespace scene { +class Camera; +class Shadows; +class Light; +} // namespace scene namespace pipeline { struct RenderObject; diff --git a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp index 7855b681d3..c8de3ee4df 100644 --- a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp +++ b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.cpp @@ -36,11 +36,13 @@ #include "gfx-base/GFXCommandBuffer.h" #include "gfx-base/GFXDescriptorSet.h" #include "gfx-base/GFXDevice.h" +#include "scene/Camera.h" #include "scene/Shadow.h" #include "scene/SpotLight.h" namespace cc { namespace pipeline { + ShadowMapBatchedQueue::ShadowMapBatchedQueue(RenderPipeline *pipeline) : _phaseID(getPhaseID("shadow-caster")) { _pipeline = pipeline; @@ -49,6 +51,8 @@ ShadowMapBatchedQueue::ShadowMapBatchedQueue(RenderPipeline *pipeline) _batchedQueue = CC_NEW(RenderBatchedQueue); } +ShadowMapBatchedQueue::~ShadowMapBatchedQueue() = default; + void ShadowMapBatchedQueue::gatherLightPasses(const scene::Camera *camera, const scene::Light *light, gfx::CommandBuffer *cmdBuffer) { clear(); diff --git a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h index 377a3be262..5d417ebbe4 100644 --- a/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h +++ b/native/cocos/renderer/pipeline/ShadowMapBatchedQueue.h @@ -26,12 +26,12 @@ #pragma once #include "Define.h" -#include "scene/Camera.h" -#include "scene/Light.h" -#include "scene/Model.h" -#include "scene/SubModel.h" - +#include "cocos/base/Macros.h" namespace cc { +namespace scene { +class Camera; +class Pass; +} // namespace scene namespace pipeline { struct RenderObject; class RenderInstancedQueue; @@ -43,7 +43,7 @@ class RenderPipeline; class CC_DLL ShadowMapBatchedQueue : public Object { public: explicit ShadowMapBatchedQueue(RenderPipeline *); - ~ShadowMapBatchedQueue() override = default; + ~ShadowMapBatchedQueue() override; void destroy(); void clear(); diff --git a/native/cocos/renderer/pipeline/UIPhase.cpp b/native/cocos/renderer/pipeline/UIPhase.cpp index b2639f8374..30e77d5848 100644 --- a/native/cocos/renderer/pipeline/UIPhase.cpp +++ b/native/cocos/renderer/pipeline/UIPhase.cpp @@ -24,11 +24,14 @@ ****************************************************************************/ #include "UIPhase.h" +#include "RenderPipeline.h" #include "gfx-base/GFXCommandBuffer.h" #include "pipeline/PipelineStateManager.h" +#include "scene/Camera.h" #include "scene/DrawBatch2D.h" #include "scene/RenderScene.h" #include "scene/SubModel.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/UIPhase.h b/native/cocos/renderer/pipeline/UIPhase.h index f3a66d14d8..27a85b7ead 100644 --- a/native/cocos/renderer/pipeline/UIPhase.h +++ b/native/cocos/renderer/pipeline/UIPhase.h @@ -24,11 +24,18 @@ ****************************************************************************/ #pragma once -#include "RenderPipeline.h" -#include "scene/Camera.h" +#include "base/Macros.h" +#include "base/TypeDef.h" namespace cc { +namespace scene { +class Camera; +} +namespace gfx { +class RenderPass; +} namespace pipeline { +class RenderPipeline; class CC_DLL UIPhase { public: diff --git a/native/cocos/renderer/pipeline/deferred/BloomStage.cpp b/native/cocos/renderer/pipeline/deferred/BloomStage.cpp index 334190ecb8..55f8e8b4e1 100644 --- a/native/cocos/renderer/pipeline/deferred/BloomStage.cpp +++ b/native/cocos/renderer/pipeline/deferred/BloomStage.cpp @@ -26,6 +26,7 @@ #include "BloomStage.h" #include "../PipelineStateManager.h" +#include "../PipelineUBO.h" #include "../RenderPipeline.h" #include "../RenderQueue.h" #include "frame-graph/DevicePass.h" @@ -40,8 +41,10 @@ #include "pipeline/Define.h" #include "pipeline/UIPhase.h" #include "renderer/pipeline/deferred/DeferredPipelineSceneData.h" +#include "scene/Camera.h" #include "scene/RenderScene.h" #include "scene/SubModel.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/deferred/BloomStage.h b/native/cocos/renderer/pipeline/deferred/BloomStage.h index 75140bb5f1..4dff1a15c9 100644 --- a/native/cocos/renderer/pipeline/deferred/BloomStage.h +++ b/native/cocos/renderer/pipeline/deferred/BloomStage.h @@ -25,6 +25,7 @@ #pragma once +#include #include "../RenderStage.h" #include "frame-graph/Handle.h" #include "pipeline/Enum.h" @@ -67,7 +68,7 @@ public: } private: - uint _phaseID = 0; + uint _phaseID = 0; static RenderStageInfo initInfo; diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp index fe2fc4a2af..0669cb5012 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.cpp @@ -24,6 +24,9 @@ ****************************************************************************/ #include "DeferredPipeline.h" +#include "../GlobalDescriptorSetManager.h" +#include "../PipelineUBO.h" +#include "../RenderPipeline.h" #include "../SceneCulling.h" #include "../helper/Utils.h" #include "../shadow/ShadowFlow.h" @@ -36,6 +39,7 @@ #include "gfx-base/GFXDevice.h" #include "gfx-base/GFXSwapchain.h" #include "gfx-base/states/GFXTextureBarrier.h" +#include "pipeline/ClusterLightCulling.h" #include "scene/RenderWindow.h" namespace cc { @@ -55,6 +59,8 @@ DeferredPipeline::DeferredPipeline() { _pipelineSceneData = new DeferredPipelineSceneData(); } +DeferredPipeline::~DeferredPipeline() = default; + framegraph::StringHandle DeferredPipeline::fgStrHandleGbufferTexture[GBUFFER_COUNT] = { framegraph::FrameGraph::stringToHandle("gbufferAlbedoTexture"), framegraph::FrameGraph::stringToHandle("gbufferNormalTexture"), diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h index df6fc269ed..79a6f1fd0e 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipeline.h @@ -28,15 +28,13 @@ #include #include -#include "gfx-base/GFXBuffer.h" -#include "gfx-base/GFXInputAssembler.h" -#include "pipeline/ClusterLightCulling.h" #include "pipeline/Enum.h" #include "pipeline/RenderPipeline.h" -#include "scene/RenderWindow.h" namespace cc { namespace pipeline { +class ClusterLightCulling; + struct UBOGlobal; struct UBOCamera; struct UBOShadow; @@ -44,7 +42,7 @@ struct UBOShadow; class CC_DLL DeferredPipeline : public RenderPipeline { public: DeferredPipeline(); - ~DeferredPipeline() override = default; + ~DeferredPipeline() override; bool initialize(const RenderPipelineInfo &info) override; bool destroy() override; diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp index bd0cd4966a..1c1b508ada 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.cpp @@ -1,11 +1,15 @@ #include "renderer/pipeline/deferred/DeferredPipelineSceneData.h" #include "renderer/pipeline/RenderPipeline.h" #include "renderer/pipeline/deferred/BloomStage.h" +#include "scene/Pass.h" #include "scene/Shadow.h" namespace cc { namespace pipeline { +DeferredPipelineSceneData::DeferredPipelineSceneData() = default; +DeferredPipelineSceneData::~DeferredPipelineSceneData() = default; + void DeferredPipelineSceneData::activate(gfx::Device *device, RenderPipeline *pipeline) { PipelineSceneData::activate(device, pipeline); initPipelinePassInfo(); diff --git a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h index 4066f55fbe..954ce193eb 100644 --- a/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h +++ b/native/cocos/renderer/pipeline/deferred/DeferredPipelineSceneData.h @@ -1,10 +1,7 @@ #pragma once #include "base/Ptr.h" -#include "core/assets/Material.h" -#include "renderer/gfx-base/GFXShader.h" #include "renderer/pipeline/PipelineSceneData.h" -#include "scene/Pass.h" #define BLOOM_PREFILTERPASS_INDEX 0 #define BLOOM_DOWNSAMPLEPASS_INDEX 1 @@ -21,8 +18,8 @@ enum class AntiAliasing { class DeferredPipelineSceneData : public PipelineSceneData { public: - DeferredPipelineSceneData() = default; - ~DeferredPipelineSceneData() override = default; + DeferredPipelineSceneData(); + ~DeferredPipelineSceneData() override; void activate(gfx::Device *device, RenderPipeline *pipeline) override; void onGlobalPipelineStateChanged() override; diff --git a/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp b/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp index 066b0fe093..7dd958daa9 100644 --- a/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp +++ b/native/cocos/renderer/pipeline/deferred/GbufferStage.cpp @@ -26,6 +26,8 @@ #include "GbufferStage.h" #include "../BatchedBuffer.h" #include "../InstancedBuffer.h" +#include "../PipelineSceneData.h" +#include "../PipelineUBO.h" #include "../PlanarShadowQueue.h" #include "../RenderBatchedQueue.h" #include "../RenderInstancedQueue.h" @@ -35,10 +37,8 @@ #include "frame-graph/DevicePass.h" #include "frame-graph/DevicePassResourceTable.h" #include "frame-graph/Resource.h" -#include "gfx-base/GFXCommandBuffer.h" #include "gfx-base/GFXDevice.h" -#include "gfx-base/GFXFramebuffer.h" -#include "gfx-base/GFXQueue.h" +#include "scene/Camera.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/deferred/GbufferStage.h b/native/cocos/renderer/pipeline/deferred/GbufferStage.h index 3d28b333d0..b823cc8ddc 100644 --- a/native/cocos/renderer/pipeline/deferred/GbufferStage.h +++ b/native/cocos/renderer/pipeline/deferred/GbufferStage.h @@ -25,7 +25,6 @@ #pragma once -#include "gfx-base/GFXFramebuffer.h" #include "pipeline/RenderStage.h" namespace cc { diff --git a/native/cocos/renderer/pipeline/deferred/LightingStage.cpp b/native/cocos/renderer/pipeline/deferred/LightingStage.cpp index 4be9bfb87f..43634c3fc2 100644 --- a/native/cocos/renderer/pipeline/deferred/LightingStage.cpp +++ b/native/cocos/renderer/pipeline/deferred/LightingStage.cpp @@ -27,8 +27,10 @@ #include "../BatchedBuffer.h" #include "../Define.h" #include "../GeometryRenderer.h" +#include "../GlobalDescriptorSetManager.h" #include "../InstancedBuffer.h" #include "../PipelineStateManager.h" +#include "../PipelineUBO.h" #include "../PlanarShadowQueue.h" #include "../RenderBatchedQueue.h" #include "../RenderInstancedQueue.h" @@ -38,11 +40,7 @@ #include "base/Utils.h" #include "frame-graph/Blackboard.h" #include "frame-graph/Handle.h" -#include "gfx-base/GFXCommandBuffer.h" -#include "gfx-base/GFXDescriptorSet.h" #include "gfx-base/GFXDevice.h" -#include "gfx-base/GFXFramebuffer.h" -#include "gfx-base/GFXQueue.h" #include "pipeline/Define.h" #include "scene/RenderScene.h" #include "scene/SphereLight.h" diff --git a/native/cocos/renderer/pipeline/deferred/PostProcessStage.cpp b/native/cocos/renderer/pipeline/deferred/PostProcessStage.cpp index a3e4dcab7b..c88096b25f 100644 --- a/native/cocos/renderer/pipeline/deferred/PostProcessStage.cpp +++ b/native/cocos/renderer/pipeline/deferred/PostProcessStage.cpp @@ -28,18 +28,20 @@ #include "frame-graph/DevicePass.h" #include "frame-graph/PassNodeBuilder.h" #include "frame-graph/Resource.h" -#include "gfx-base/GFXCommandBuffer.h" #include "gfx-base/GFXDevice.h" -#include "gfx-base/GFXFramebuffer.h" #include "pipeline/Define.h" #include "pipeline/helper/Utils.h" +#include "renderer/pipeline/GlobalDescriptorSetManager.h" #include "renderer/pipeline/PipelineStateManager.h" +#include "renderer/pipeline/PipelineUBO.h" #include "renderer/pipeline/RenderPipeline.h" #include "renderer/pipeline/RenderQueue.h" #include "renderer/pipeline/UIPhase.h" #include "renderer/pipeline/deferred/DeferredPipelineSceneData.h" +#include "scene/Camera.h" #include "scene/RenderWindow.h" #include "scene/SubModel.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp b/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp index c76937e9a7..09841352cf 100644 --- a/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp +++ b/native/cocos/renderer/pipeline/forward/ForwardPipeline.cpp @@ -24,6 +24,9 @@ ****************************************************************************/ #include "ForwardPipeline.h" +#include "../GlobalDescriptorSetManager.h" +#include "../PipelineSceneData.h" +#include "../PipelineUBO.h" #include "../SceneCulling.h" #include "../helper/Utils.h" #include "../shadow/ShadowFlow.h" diff --git a/native/cocos/renderer/pipeline/forward/ForwardPipeline.h b/native/cocos/renderer/pipeline/forward/ForwardPipeline.h index f1789b5a94..b8c6f06431 100644 --- a/native/cocos/renderer/pipeline/forward/ForwardPipeline.h +++ b/native/cocos/renderer/pipeline/forward/ForwardPipeline.h @@ -27,8 +27,6 @@ #include #include "../RenderPipeline.h" -#include "frame-graph/FrameGraph.h" -#include "frame-graph/Handle.h" #include "pipeline/Enum.h" namespace cc { diff --git a/native/cocos/renderer/pipeline/forward/ForwardStage.cpp b/native/cocos/renderer/pipeline/forward/ForwardStage.cpp index a1205bf38d..5c6fc9c4e0 100644 --- a/native/cocos/renderer/pipeline/forward/ForwardStage.cpp +++ b/native/cocos/renderer/pipeline/forward/ForwardStage.cpp @@ -27,6 +27,8 @@ #include "../BatchedBuffer.h" #include "../GeometryRenderer.h" #include "../InstancedBuffer.h" +#include "../PipelineSceneData.h" +#include "../PipelineUBO.h" #include "../PlanarShadowQueue.h" #include "../RenderAdditiveLightQueue.h" #include "../RenderBatchedQueue.h" @@ -37,6 +39,7 @@ #include "gfx-base/GFXCommandBuffer.h" #include "gfx-base/GFXFramebuffer.h" #include "pipeline/UIPhase.h" +#include "scene/Camera.h" #include "scene/RenderWindow.h" namespace cc { diff --git a/native/cocos/renderer/pipeline/helper/Utils.cpp b/native/cocos/renderer/pipeline/helper/Utils.cpp index 50c871145c..dad4f243c3 100644 --- a/native/cocos/renderer/pipeline/helper/Utils.cpp +++ b/native/cocos/renderer/pipeline/helper/Utils.cpp @@ -32,6 +32,7 @@ #include "scene/Model.h" #include "scene/RenderWindow.h" #include "scene/SubModel.h" +#include "scene/Pass.h" namespace cc { namespace pipeline { diff --git a/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp b/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp index b1890eed21..517c5fac7c 100644 --- a/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp +++ b/native/cocos/renderer/pipeline/shadow/ShadowFlow.cpp @@ -26,15 +26,17 @@ #include "ShadowFlow.h" #include "../Define.h" +#include "../GlobalDescriptorSetManager.h" +#include "../PipelineSceneData.h" +#include "../RenderPipeline.h" #include "../SceneCulling.h" #include "../forward/ForwardPipeline.h" #include "ShadowStage.h" #include "gfx-base/GFXDevice.h" -#include "gfx-base/GFXFramebuffer.h" -#include "gfx-base/GFXRenderPass.h" -#include "gfx-base/GFXTexture.h" +#include "scene/Camera.h" #include "scene/DirectionalLight.h" #include "scene/RenderScene.h" +#include "scene/Shadow.h" namespace cc { namespace pipeline { @@ -48,6 +50,7 @@ RenderFlowInfo ShadowFlow::initInfo = { }; const RenderFlowInfo &ShadowFlow::getInitializeInfo() { return ShadowFlow::initInfo; } +ShadowFlow::ShadowFlow() = default; ShadowFlow::~ShadowFlow() = default; bool ShadowFlow::initialize(const RenderFlowInfo &info) { diff --git a/native/cocos/renderer/pipeline/shadow/ShadowFlow.h b/native/cocos/renderer/pipeline/shadow/ShadowFlow.h index c7ab8c423c..d2e7b58fa6 100644 --- a/native/cocos/renderer/pipeline/shadow/ShadowFlow.h +++ b/native/cocos/renderer/pipeline/shadow/ShadowFlow.h @@ -27,7 +27,6 @@ #include "../RenderFlow.h" #include "scene/Define.h" -#include "scene/Light.h" namespace cc { namespace pipeline { @@ -35,7 +34,7 @@ class ForwardPipeline; class CC_DLL ShadowFlow : public RenderFlow { public: - ShadowFlow() = default; + ShadowFlow(); ~ShadowFlow() override; static const RenderFlowInfo &getInitializeInfo(); diff --git a/native/cocos/renderer/pipeline/shadow/ShadowStage.cpp b/native/cocos/renderer/pipeline/shadow/ShadowStage.cpp index 536c4e793f..6f628ee3f0 100644 --- a/native/cocos/renderer/pipeline/shadow/ShadowStage.cpp +++ b/native/cocos/renderer/pipeline/shadow/ShadowStage.cpp @@ -25,16 +25,22 @@ #include "ShadowStage.h" #include "../Define.h" +#include "../PipelineSceneData.h" +#include "../PipelineUBO.h" #include "../RenderPipeline.h" #include "../ShadowMapBatchedQueue.h" #include "gfx-base/GFXCommandBuffer.h" #include "gfx-base/GFXFramebuffer.h" #include "math/Vec2.h" +#include "scene/Camera.h" #include "scene/Shadow.h" namespace cc { namespace pipeline { +ShadowStage::ShadowStage() = default; +ShadowStage::~ShadowStage() = default; + RenderStageInfo ShadowStage::initInfo = { "ShadowStage", static_cast(ForwardStagePriority::FORWARD), diff --git a/native/cocos/renderer/pipeline/shadow/ShadowStage.h b/native/cocos/renderer/pipeline/shadow/ShadowStage.h index 7f80f449e2..2947adc407 100644 --- a/native/cocos/renderer/pipeline/shadow/ShadowStage.h +++ b/native/cocos/renderer/pipeline/shadow/ShadowStage.h @@ -25,7 +25,6 @@ #pragma once #include "../RenderStage.h" -#include "scene/Light.h" namespace cc { namespace pipeline { @@ -34,8 +33,8 @@ class ShadowMapBatchedQueue; class CC_DLL ShadowStage : public RenderStage { public: - ShadowStage() = default; - ~ShadowStage() override = default; + ShadowStage(); + ~ShadowStage() override; static const RenderStageInfo &getInitializeInfo(); diff --git a/native/cocos/scene/Ambient.cpp b/native/cocos/scene/Ambient.cpp index 251728ae4a..03c53d9eb0 100644 --- a/native/cocos/scene/Ambient.cpp +++ b/native/cocos/scene/Ambient.cpp @@ -26,6 +26,7 @@ #include "scene/Ambient.h" #include "core/Root.h" #include "renderer/pipeline/RenderPipeline.h" +#include "renderer/pipeline/PipelineSceneData.h" namespace { cc::Color col; diff --git a/native/cocos/scene/DirectionalLight.cpp b/native/cocos/scene/DirectionalLight.cpp index 9c5a6e85f1..236ccca967 100644 --- a/native/cocos/scene/DirectionalLight.cpp +++ b/native/cocos/scene/DirectionalLight.cpp @@ -26,6 +26,7 @@ #include "scene/DirectionalLight.h" #include "core/Root.h" #include "core/scene-graph/Node.h" +#include "renderer/pipeline/PipelineSceneData.h" #include "renderer/pipeline/RenderPipeline.h" namespace cc { diff --git a/native/cocos/scene/Model.cpp b/native/cocos/scene/Model.cpp index 4a690a852c..f77b437d51 100644 --- a/native/cocos/scene/Model.cpp +++ b/native/cocos/scene/Model.cpp @@ -114,6 +114,8 @@ Model::Model() { _device = Root::getInstance()->getDevice(); } +Model::~Model() = default; + void Model::initialize() { if (_inited) return; _receiveShadow = true; diff --git a/native/cocos/scene/Model.h b/native/cocos/scene/Model.h index 868337d26c..27226441c6 100644 --- a/native/cocos/scene/Model.h +++ b/native/cocos/scene/Model.h @@ -76,7 +76,7 @@ public: }; Model(); - ~Model() override = default; + ~Model() override; void initialize(); virtual void destroy(); diff --git a/native/cocos/scene/RenderScene.cpp b/native/cocos/scene/RenderScene.cpp index 7969d1ca0d..3a0b37883c 100644 --- a/native/cocos/scene/RenderScene.cpp +++ b/native/cocos/scene/RenderScene.cpp @@ -32,6 +32,7 @@ #include "base/Log.h" #include "core/scene-graph/Node.h" #include "renderer/pipeline/RenderPipeline.h" +#include "renderer/pipeline/PipelineSceneData.h" #include "scene/Camera.h" #include "scene/DirectionalLight.h" #include "scene/DrawBatch2D.h" diff --git a/native/cocos/scene/Skybox.cpp b/native/cocos/scene/Skybox.cpp index e6ae68c437..58929449ad 100644 --- a/native/cocos/scene/Skybox.cpp +++ b/native/cocos/scene/Skybox.cpp @@ -36,6 +36,7 @@ #include "renderer/core/MaterialInstance.h" #include "renderer/core/PassUtils.h" #include "renderer/gfx-base/GFXDevice.h" +#include "renderer/pipeline/PipelineSceneData.h" #include "scene/Ambient.h" #include "scene/Model.h" @@ -47,7 +48,7 @@ namespace cc { namespace scene { SkyboxInfo::SkyboxInfo(/* args */) = default; -SkyboxInfo::~SkyboxInfo() = default; +SkyboxInfo::~SkyboxInfo() = default; void SkyboxInfo::setEnabled(bool val) { _enabled = val; diff --git a/native/cocos/scene/SphereLight.cpp b/native/cocos/scene/SphereLight.cpp index e5838173d4..265ff01d2c 100644 --- a/native/cocos/scene/SphereLight.cpp +++ b/native/cocos/scene/SphereLight.cpp @@ -26,7 +26,7 @@ #include "scene/SphereLight.h" #include "core/Root.h" #include "core/scene-graph/Node.h" - +#include "renderer/pipeline/PipelineSceneData.h" namespace cc { namespace scene { SphereLight::SphereLight() { diff --git a/native/cocos/scene/SpotLight.cpp b/native/cocos/scene/SpotLight.cpp index 62769b42f3..c6049e3600 100644 --- a/native/cocos/scene/SpotLight.cpp +++ b/native/cocos/scene/SpotLight.cpp @@ -28,6 +28,7 @@ #include "core/Root.h" #include "core/scene-graph/Node.h" #include "math/Math.h" +#include "renderer/pipeline/PipelineSceneData.h" #include "renderer/pipeline/RenderPipeline.h" namespace cc { diff --git a/native/cocos/scene/SubModel.cpp b/native/cocos/scene/SubModel.cpp index c31a44ccff..fc9654fd7c 100644 --- a/native/cocos/scene/SubModel.cpp +++ b/native/cocos/scene/SubModel.cpp @@ -27,6 +27,7 @@ #include "core/Root.h" #include "core/platform/Debug.h" #include "pipeline/Define.h" +#include "renderer/pipeline/PipelineSceneData.h" #include "renderer/pipeline/forward/ForwardPipeline.h" #include "scene/Model.h" #include "scene/Pass.h" @@ -53,7 +54,7 @@ void SubModel::update() { void SubModel::setPasses(const std::shared_ptr>> &pPasses) { if (!pPasses || pPasses->size() > MAX_PASS_COUNT) { - debug::errorID(12004, MAX_PASS_COUNT); + debug::errorID(12004, MAX_PASS_COUNT); return; }