diff --git a/cocos/rendering/debug-view.ts b/cocos/rendering/debug-view.ts index 508f0a12f3..fda4f183fe 100644 --- a/cocos/rendering/debug-view.ts +++ b/cocos/rendering/debug-view.ts @@ -112,63 +112,45 @@ export class DebugView { * @en Toggle rendering single debug mode. * @zh 设置渲染单项调试模式。 */ - public get singleMode () : DebugViewSingleType { + public get singleMode (): DebugViewSingleType { return this._singleMode; } - public set singleMode (val : DebugViewSingleType) { + public set singleMode (val: DebugViewSingleType) { this._singleMode = val; this._updatePipeline(); - - if (JSB && this._nativeConfig) { - this._nativeConfig.singleMode = this._singleMode; - } } /** * @en Toggle normal / pure lighting mode. * @zh 切换正常光照和仅光照模式。 */ - public get lightingWithAlbedo () : boolean { + public get lightingWithAlbedo (): boolean { return this._lightingWithAlbedo; } - public set lightingWithAlbedo (val : boolean) { + public set lightingWithAlbedo (val: boolean) { this._lightingWithAlbedo = val; this._updatePipeline(); - - if (JSB && this._nativeConfig) { - this._nativeConfig.lightingWithAlbedo = this._lightingWithAlbedo; - } } /** * @en Toggle CSM layer coloration mode. * @zh 切换级联阴影染色调试模式。 */ - public get csmLayerColoration () : boolean { + public get csmLayerColoration (): boolean { return this._csmLayerColoration; } - public set csmLayerColoration (val : boolean) { + public set csmLayerColoration (val: boolean) { this._csmLayerColoration = val; this._updatePipeline(); - - if (JSB && this._nativeConfig) { - this._nativeConfig.csmLayerColoration = this._csmLayerColoration; - } } protected _singleMode = DebugViewSingleType.NONE; protected _compositeModeValue = 0; protected _lightingWithAlbedo = true; protected _csmLayerColoration = false; - protected _nativeConfig: any = null; constructor () { this._activate(); - if (JSB && this._nativeConfig === null) { - // @ts-expect-error jsb object access - this._nativeConfig = new jsb.DebugViewConfig(); - this._nativeConfig.compositeModeBitCount = DebugViewCompositeType.MAX_BIT_COUNT; - } } /** @@ -176,7 +158,7 @@ export class DebugView { * @zh 获取指定的渲染组合调试模式是否开启。 * @param Specified composite type. */ - public isCompositeModeEnabled (val : number) : boolean { + public isCompositeModeEnabled (val: number): boolean { const mode = this._compositeModeValue & (1 << val); return mode !== 0; } @@ -224,13 +206,6 @@ export class DebugView { this._enableAllCompositeMode(true); this._lightingWithAlbedo = true; this._csmLayerColoration = false; - - if (JSB && this._nativeConfig) { - this._nativeConfig.singleMode = this._singleMode; - this._nativeConfig.compositeModeValue = this._compositeModeValue; - this._nativeConfig.lightingWithAlbedo = this._lightingWithAlbedo; - this._nativeConfig.csmLayerColoration = this._csmLayerColoration; - } } protected _updatePipeline () { @@ -251,10 +226,6 @@ export class DebugView { } else { this._compositeModeValue &= (~(1 << val)); } - - if (JSB && this._nativeConfig) { - this._nativeConfig.compositeModeValue = this._compositeModeValue; - } } private _enableAllCompositeMode (enable: boolean) { @@ -264,14 +235,10 @@ export class DebugView { } else { this._compositeModeValue &= (~(1 << i)); } - - if (JSB && this._nativeConfig) { - this._nativeConfig.compositeModeValue = this._compositeModeValue; - } } } - private _getType () : RenderingDebugViewType { + private _getType (): RenderingDebugViewType { if (this._singleMode !== DebugViewSingleType.NONE) { return RenderingDebugViewType.SINGLE; } else if (this._lightingWithAlbedo !== true || this._csmLayerColoration !== false) { diff --git a/cocos/rendering/pipeline-ubo.ts b/cocos/rendering/pipeline-ubo.ts index ad08c2c47b..e7c6f23d6b 100644 --- a/cocos/rendering/pipeline-ubo.ts +++ b/cocos/rendering/pipeline-ubo.ts @@ -71,20 +71,11 @@ export class PipelineUBO { fv[UBOGlobal.NATIVE_SIZE_OFFSET + 3] = 1.0 / fv[UBOGlobal.NATIVE_SIZE_OFFSET + 1]; const debugView = root.debugView; - if (debugView) { - fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET] = debugView.singleMode as number; - fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET + 1] = debugView.lightingWithAlbedo ? 1.0 : 0.0; - fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET + 2] = debugView.csmLayerColoration ? 1.0 : 0.0; - for (let i = DebugViewCompositeType.DIRECT_DIFFUSE as number; i < DebugViewCompositeType.MAX_BIT_COUNT; i++) { - fv[UBOGlobal.DEBUG_VIEW_COMPOSITE_PACK_1_OFFSET + i] = debugView.isCompositeModeEnabled(i) ? 1.0 : 0.0; - } - } else { - fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET] = 0.0; - fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET + 1] = 1.0; - fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET + 2] = 0.0; - for (let i = DebugViewCompositeType.DIRECT_DIFFUSE as number; i < DebugViewCompositeType.MAX_BIT_COUNT; i++) { - fv[UBOGlobal.DEBUG_VIEW_COMPOSITE_PACK_1_OFFSET + i] = 1.0; - } + fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET] = debugView.singleMode as number; + fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET + 1] = debugView.lightingWithAlbedo ? 1.0 : 0.0; + fv[UBOGlobal.DEBUG_VIEW_MODE_OFFSET + 2] = debugView.csmLayerColoration ? 1.0 : 0.0; + for (let i = DebugViewCompositeType.DIRECT_DIFFUSE as number; i < DebugViewCompositeType.MAX_BIT_COUNT; i++) { + fv[UBOGlobal.DEBUG_VIEW_COMPOSITE_PACK_1_OFFSET + i] = debugView.isCompositeModeEnabled(i) ? 1.0 : 0.0; } } diff --git a/cocos/root.jsb.ts b/cocos/root.jsb.ts index 956ff61c14..8ca1d54ea6 100644 --- a/cocos/root.jsb.ts +++ b/cocos/root.jsb.ts @@ -26,7 +26,6 @@ import { legacyCC } from './core/global-exports'; import { DataPoolManager } from './3d/skeletal-animation/data-pool-manager'; import { Device, deviceManager } from './gfx'; import { EDITOR } from "internal:constants"; -import { DebugView } from './rendering/debug-view'; import { buildDeferredLayout, buildForwardLayout } from './rendering/custom/effect'; import { settings, Settings, warnID, Pool, macro } from './core'; import { ForwardPipeline } from './rendering'; @@ -89,14 +88,6 @@ Object.defineProperty(rootProto, 'pipelineEvent', { } }); -Object.defineProperty(rootProto, 'debugView', { - configurable: true, - enumerable: true, - get() { - return this._debugView; - } -}); - class DummyPipelineEvent { on(type: any, callback: any, target?: any, once?: boolean) { } once(type: any, callback: any, target?: any) { } @@ -114,8 +105,6 @@ rootProto._ctor = function (device: Device) { this._lightPools = new Map(); this._batcher = null; this._pipelineEvent = new DummyPipelineEvent(); - this._debugView = new DebugView(); - this.setDebugViewConfig(this._debugView._nativeConfig); this._registerListeners(); }; diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 201188e535..c08f7d4af2 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -1310,6 +1310,8 @@ cocos_source_files( cocos/renderer/pipeline/deferred/PostProcessStage.h cocos/renderer/pipeline/UIPhase.cpp cocos/renderer/pipeline/UIPhase.h + cocos/renderer/pipeline/DebugView.cpp + cocos/renderer/pipeline/DebugView.h cocos/renderer/pipeline/helper/Utils.h cocos/renderer/pipeline/helper/Utils.cpp cocos/renderer/pipeline/custom/BinaryArchive.h diff --git a/native/cocos/core/Root.cpp b/native/cocos/core/Root.cpp index 9edc74cb48..b751baea39 100644 --- a/native/cocos/core/Root.cpp +++ b/native/cocos/core/Root.cpp @@ -92,6 +92,8 @@ void Root::initialize(gfx::Swapchain * /*swapchain*/) { uint32_t maxJoints = (_device->getCapabilities().maxVertexUniformVectors - usedUBOVectorCount) / 3; maxJoints = maxJoints < 256 ? maxJoints : 256; pipeline::localDescriptorSetLayoutResizeMaxJoints(maxJoints); + + _debugView = std::make_unique(); } render::Pipeline *Root::getCustomPipeline() const { @@ -161,6 +163,8 @@ void Root::destroy() { } _swapchains.clear(); + _debugView.reset(); + // TODO(minggo): // this.dataPoolManager.clear(); } diff --git a/native/cocos/core/Root.h b/native/cocos/core/Root.h index 306f2a40ad..faf2a0451b 100644 --- a/native/cocos/core/Root.h +++ b/native/cocos/core/Root.h @@ -29,6 +29,7 @@ #include "core/event/Event.h" #include "core/memop/Pool.h" #include "renderer/pipeline/RenderPipeline.h" +#include "renderer/pipeline/DebugView.h" #include "scene/DrawBatch2D.h" #include "scene/Light.h" #include "scene/Model.h" @@ -52,14 +53,6 @@ class Pipeline; } // namespace render class Batcher2d; -struct CC_DLL DebugViewConfig { - uint8_t singleMode; - uint8_t compositeModeBitCount; - uint32_t compositeModeValue; - bool lightingWithAlbedo; - bool csmLayerColoration; -}; - struct ISystemWindowInfo; class ISystemWindow; @@ -255,8 +248,7 @@ public: * @zh * 渲染调试数据 */ - inline void setDebugViewConfig(const DebugViewConfig &config) { _debugViewConfig = config; } - inline const DebugViewConfig &getDebugViewConfig() const { return _debugViewConfig; } + inline pipeline::DebugView *getDebugView() const { return _debugView.get(); } /** * @zh @@ -320,7 +312,7 @@ private: std::unique_ptr _pipelineRuntime; // IntrusivePtr _dataPoolMgr; ccstd::vector> _scenes; - DebugViewConfig _debugViewConfig; + std::unique_ptr _debugView; float _cumulativeTime{0.F}; float _frameTime{0.F}; float _fpsTime{0.F}; diff --git a/native/cocos/renderer/pipeline/DebugView.cpp b/native/cocos/renderer/pipeline/DebugView.cpp new file mode 100644 index 0000000000..33948e3753 --- /dev/null +++ b/native/cocos/renderer/pipeline/DebugView.cpp @@ -0,0 +1,67 @@ +/**************************************************************************** + Copyright (c) 2023 Xiamen Yaji Software Co., Ltd. + + http://www.cocos.com + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +****************************************************************************/ + +#include "DebugView.h" +#include "custom/RenderInterfaceTypes.h" +#include "RenderPipeline.h" +#include "core/Root.h" + +namespace cc { + +namespace pipeline { + +void DebugView::activate() { + _singleMode = DebugViewSingleType::NONE; + enableAllCompositeModeValue(true); + _lightingWithAlbedo = true; + _csmLayerColoration = false; +} + +void DebugView::updatePipeline() { + Root *root = Root::getInstance(); + auto *pipeline = root->getPipeline(); + + auto useDebugViewValue = static_cast(getType()); + + bool valueChanged = false; + auto iter = pipeline->getMacros().find("CC_USE_DEBUG_VIEW"); + if (iter != pipeline->getMacros().end()) { + const MacroValue ¯oValue = iter->second; + const int32_t *macroPtr = ccstd::get_if(¯oValue); + if (macroPtr != nullptr && (*macroPtr != useDebugViewValue)) { + pipeline->setValue("CC_USE_DEBUG_VIEW", useDebugViewValue); + valueChanged = true; + } + } else { + pipeline->setValue("CC_USE_DEBUG_VIEW", useDebugViewValue); + valueChanged = true; + } + + if (valueChanged) { + root->onGlobalPipelineStateChanged(); + } +} + +} // namespace pipeline +} // namespace cc diff --git a/native/cocos/renderer/pipeline/DebugView.h b/native/cocos/renderer/pipeline/DebugView.h new file mode 100644 index 0000000000..3a53ded416 --- /dev/null +++ b/native/cocos/renderer/pipeline/DebugView.h @@ -0,0 +1,243 @@ +/* + Copyright (c) 2023 Xiamen Yaji Software Co., Ltd. + + https://www.cocos.com/ + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#pragma once +#include "base/TypeDef.h" + +namespace cc { + +namespace pipeline { + +enum class RenderingDebugViewType { + NONE, + SINGLE, + COMPOSITE_AND_MISC, +}; + +/** + * @zh + * 渲染单项调试模式 + * @en + * Rendering single debug mode + * @readonly + */ +enum class DebugViewSingleType { + NONE, + VERTEX_COLOR, + VERTEX_NORMAL, + VERTEX_TANGENT, + WORLD_POS, + VERTEX_MIRROR, + FACE_SIDE, + UV0, + UV1, + UV_LIGHTMAP, + PROJ_DEPTH, + LINEAR_DEPTH, + + FRAGMENT_NORMAL, + FRAGMENT_TANGENT, + FRAGMENT_BINORMAL, + BASE_COLOR, + DIFFUSE_COLOR, + SPECULAR_COLOR, + TRANSPARENCY, + METALLIC, + ROUGHNESS, + SPECULAR_INTENSITY, + + DIRECT_DIFFUSE, + DIRECT_SPECULAR, + DIRECT_ALL, + ENV_DIFFUSE, + ENV_SPECULAR, + ENV_ALL, + EMISSIVE, + LIGHT_MAP, + SHADOW, + AO, + + FOG, +}; + +/** + * @zh + * 渲染组合调试模式 + * @en + * Rendering composite debug mode + * @readonly + */ +enum class DebugViewCompositeType { + DIRECT_DIFFUSE = 0, + DIRECT_SPECULAR, + ENV_DIFFUSE, + ENV_SPECULAR, + EMISSIVE, + LIGHT_MAP, + SHADOW, + AO, + + NORMAL_MAP, + FOG, + + TONE_MAPPING, + GAMMA_CORRECTION, + MAX_BIT_COUNT +}; + +/** + * @en Rendering debug view control class + * @zh 渲染调试控制类 + */ +// @ccclass('cc.DebugView') +// @help('i18n:cc.DebugView') +class DebugView final { +public: + DebugView() { + activate(); + } + ~DebugView() = default; + + /** + * @en Toggle rendering single debug mode. + * @zh 设置渲染单项调试模式。 + */ + inline DebugViewSingleType getSingleMode() const { return _singleMode; } + inline void setSingleMode(DebugViewSingleType val) { + _singleMode = val; + updatePipeline(); + } + + /** + * @en Toggle normal / pure lighting mode. + * @zh 切换正常光照和仅光照模式。 + */ + inline bool isLightingWithAlbedo() const { return _lightingWithAlbedo; } + inline void setLightingWithAlbedo(bool val) { + _lightingWithAlbedo = val; + updatePipeline(); + } + + /** + * @en Toggle CSM layer coloration mode. + * @zh 切换级联阴影染色调试模式。 + */ + inline bool isCsmLayerColoration() const { return _csmLayerColoration; } + inline void setCsmLayerColoration(bool val) { + _csmLayerColoration = val; + updatePipeline(); + } + + /** + * @en Whether enabled with specified rendering composite debug mode. + * @zh 获取指定的渲染组合调试模式是否开启。 + * @param Specified composite type. + */ + inline bool isCompositeModeEnabled (uint32_t val) const { + uint32_t mode = _compositeModeValue & (1 << val); + return mode != 0; + } + /** + * @en Toggle specified rendering composite debug mode. + * @zh 开关指定的渲染组合调试模式。 + * @param Specified composite type, enable or disable. + */ + inline void enableCompositeMode (DebugViewCompositeType val, bool enable) { + enableCompositeModeValue(val, enable); + updatePipeline(); + } + + /** + * @en Toggle all rendering composite debug mode. + * @zh 开关所有的渲染组合调试模式。 + */ + inline void enableAllCompositeMode (bool enable) { + enableAllCompositeModeValue(enable); + updatePipeline(); + } + + /** + * @en Get rendering debug view on / off state. + * @zh 查询当前是否开启了渲染调试模式。 + */ + inline bool isEnabled() const { + return getType() != RenderingDebugViewType::NONE; + } + + /** + * @en Disable all debug view modes, reset to standard rendering mode. + * @zh 关闭所有的渲染调试模式,恢复到正常渲染。 + */ + void reset () { + activate(); + updatePipeline(); + } + +protected: + void activate(); + void updatePipeline(); + +private: + inline void enableCompositeModeValue(DebugViewCompositeType val, bool enable) { + if (enable) { + _compositeModeValue |= (1 << static_cast(val)); + } else { + _compositeModeValue &= (~(1 << static_cast(val))); + } + } + + inline void enableAllCompositeModeValue(bool enable) { + for (int i = 0; i < static_cast(DebugViewCompositeType::MAX_BIT_COUNT); ++i) { + if (enable) { + _compositeModeValue |= (1 << i); + } else { + _compositeModeValue &= (~(1 << i)); + } + } + } + + inline RenderingDebugViewType getType () const { + if (_singleMode != DebugViewSingleType::NONE) { + return RenderingDebugViewType::SINGLE; + } else if (!_lightingWithAlbedo || _csmLayerColoration) { + return RenderingDebugViewType::COMPOSITE_AND_MISC; + } else { + for (int i = 0; i < static_cast(DebugViewCompositeType::MAX_BIT_COUNT); ++i) { + if (!isCompositeModeEnabled(i)) { + return RenderingDebugViewType::COMPOSITE_AND_MISC; + } + } + } + return RenderingDebugViewType::NONE; + } + +private: + DebugViewSingleType _singleMode{DebugViewSingleType::NONE}; + uint32_t _compositeModeValue{0}; + bool _lightingWithAlbedo{true}; + bool _csmLayerColoration{false}; +}; + +} // namespace pipeline +} // namespace cc diff --git a/native/cocos/renderer/pipeline/PipelineUBO.cpp b/native/cocos/renderer/pipeline/PipelineUBO.cpp index c5c23b61d1..12d18a2f95 100644 --- a/native/cocos/renderer/pipeline/PipelineUBO.cpp +++ b/native/cocos/renderer/pipeline/PipelineUBO.cpp @@ -78,13 +78,12 @@ void PipelineUBO::updateGlobalUBOView(const scene::Camera *camera, ccstd::array< uboGlobalView[UBOGlobal::NATIVE_SIZE_OFFSET + 2] = 1.0F / uboGlobalView[UBOGlobal::NATIVE_SIZE_OFFSET]; uboGlobalView[UBOGlobal::NATIVE_SIZE_OFFSET + 3] = 1.0F / uboGlobalView[UBOGlobal::NATIVE_SIZE_OFFSET + 1]; - auto debugViewConfig = root->getDebugViewConfig(); - uboGlobalView[UBOGlobal::DEBUG_VIEW_MODE_OFFSET] = debugViewConfig.singleMode; - uboGlobalView[UBOGlobal::DEBUG_VIEW_MODE_OFFSET + 1] = debugViewConfig.lightingWithAlbedo; - uboGlobalView[UBOGlobal::DEBUG_VIEW_MODE_OFFSET + 2] = debugViewConfig.csmLayerColoration; - for (int i = 0; i < debugViewConfig.compositeModeBitCount; i++) { - uint32_t mode = debugViewConfig.compositeModeValue & (1 << i); - uboGlobalView[UBOGlobal::DEBUG_VIEW_COMPOSITE_PACK_1_OFFSET + i] = mode ? 1.0 : 0.0; + auto *debugView = root->getDebugView(); + uboGlobalView[UBOGlobal::DEBUG_VIEW_MODE_OFFSET] = static_cast(debugView->getSingleMode()); + uboGlobalView[UBOGlobal::DEBUG_VIEW_MODE_OFFSET + 1] = debugView->isLightingWithAlbedo() ? 1.0F : 0.0F; + uboGlobalView[UBOGlobal::DEBUG_VIEW_MODE_OFFSET + 2] = debugView->isCsmLayerColoration() ? 1.0F : 0.0F; + for (int i = 0; i < static_cast(pipeline::DebugViewCompositeType::MAX_BIT_COUNT); ++i) { + uboGlobalView[UBOGlobal::DEBUG_VIEW_COMPOSITE_PACK_1_OFFSET + i] = debugView->isCompositeModeEnabled(i) ? 1.0F : 0.0F; } } diff --git a/native/tools/swig-config/pipeline.i b/native/tools/swig-config/pipeline.i index d19faad42d..147c8e6539 100644 --- a/native/tools/swig-config/pipeline.i +++ b/native/tools/swig-config/pipeline.i @@ -26,6 +26,7 @@ #include "renderer/pipeline/PipelineSceneData.h" #include "renderer/pipeline/BatchedBuffer.h" #include "renderer/pipeline/GeometryRenderer.h" +#include "renderer/pipeline/DebugView.h" #include "renderer/pipeline/reflection-probe/ReflectionProbeFlow.h" #include "renderer/pipeline/reflection-probe/ReflectionProbeStage.h" %} @@ -182,6 +183,10 @@ using namespace cc; %attribute(cc::pipeline::RenderFlow, uint32_t, _tag, getTag, setTag); %attribute(cc::pipeline::RenderFlow, cc::pipeline::RenderStageList, _stages, getStages, setStages); +%attribute(cc::pipeline::DebugView, cc::pipeline::DebugViewSingleType, singleMode, getSingleMode, setSingleMode); +%attribute(cc::pipeline::DebugView, bool, lightingWithAlbedo, isLightingWithAlbedo, setLightingWithAlbedo); +%attribute(cc::pipeline::DebugView, bool, csmLayerColoration, isCsmLayerColoration, setCsmLayerColoration); + #define CC_USE_GEOMETRY_RENDERER 1 // ----- Import Section ------ @@ -221,6 +226,7 @@ using namespace cc; %include "renderer/pipeline/RenderPipeline.h" %include "renderer/pipeline/RenderFlow.h" %include "renderer/pipeline/RenderStage.h" +%include "renderer/pipeline/DebugView.h" %include "renderer/pipeline/forward/ForwardPipeline.h" %include "renderer/pipeline/forward/ForwardFlow.h" diff --git a/native/tools/swig-config/scene.i b/native/tools/swig-config/scene.i index 034f4d6e1c..6c27a05129 100644 --- a/native/tools/swig-config/scene.i +++ b/native/tools/swig-config/scene.i @@ -243,6 +243,7 @@ using namespace cc; %attribute(cc::Root, cc::render::PipelineRuntime *, pipeline, getPipeline); %attribute(cc::Root, cc::render::Pipeline*, customPipeline, getCustomPipeline); %attribute(cc::Root, %arg(ccstd::vector &), cameraList, getCameraList); +%attribute(cc::Root, cc::pipeline::DebugView*, debugView, getDebugView); %attribute(cc::scene::RenderWindow, uint32_t, width, getWidth); %attribute(cc::scene::RenderWindow, uint32_t, height, getHeight);