diff --git a/cocos/core/root.jsb.ts b/cocos/core/root.jsb.ts index 0db2ec8c32..1c09b49bf5 100644 --- a/cocos/core/root.jsb.ts +++ b/cocos/core/root.jsb.ts @@ -4,7 +4,6 @@ import { Batcher2D } from '../2d/renderer/batcher-2d'; import legacyCC from '../../predefine'; import { DataPoolManager } from '../3d/skeletal-animation/data-pool-manager'; import { Device } from './gfx'; -import { createCustomPipeline } from './pipeline/custom'; declare const nr: any; declare const jsb: any; @@ -44,14 +43,6 @@ Object.defineProperty(rootProto, 'dataPoolManager', { }, }); -Object.defineProperty(rootProto, 'pipeline', { - configurable: true, - enumerable: true, - get () { - return this._pipeline; - } -}); - Object.defineProperty(rootProto, 'pipelineEvent', { configurable: true, enumerable: true, @@ -76,10 +67,7 @@ rootProto._ctor = function (device: Device) { this._modelPools = new Map(); this._lightPools = new Map(); this._batcher = null; - this._pipeline = null; this._pipelineEvent = new DummyPipelineEvent(); - this._classicPipeline = null; - this._customPipeline = null; this._registerListeners(); }; @@ -176,19 +164,14 @@ rootProto.frameMove = function (deltaTime: number) { const oldSetPipeline = rootProto.setRenderPipeline; rootProto.setRenderPipeline = function (pipeline) { - if (!pipeline) { - // pipeline should not be created in C++, ._ctor need to be triggered - pipeline = new nr.ForwardPipeline(); - pipeline.init(); - } - if (this.usesCustomPipeline()) { - this._customPipeline = createCustomPipeline(); - this._pipeline = this._customPipeline; + return oldSetPipeline.call(this, null); } else { - this._classicPipeline = pipeline; - this._pipeline = this._classicPipeline; + if (!pipeline) { + // pipeline should not be created in C++, ._ctor need to be triggered + pipeline = new nr.ForwardPipeline(); + pipeline.init(); + } + return oldSetPipeline.call(this, pipeline); } - - return oldSetPipeline.call(this, pipeline); } diff --git a/native/cocos/bindings/auto/jsb_scene_auto.cpp b/native/cocos/bindings/auto/jsb_scene_auto.cpp index 7208ee5953..b032a8b0dd 100644 --- a/native/cocos/bindings/auto/jsb_scene_auto.cpp +++ b/native/cocos/bindings/auto/jsb_scene_auto.cpp @@ -9901,7 +9901,7 @@ static bool js_scene_Root_getPipeline(se::State& s) // NOLINT(readability-identi SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 0); return false; } -SE_BIND_FUNC(js_scene_Root_getPipeline) +SE_BIND_FUNC_AS_PROP_GET(js_scene_Root_getPipeline) static bool js_scene_Root_getScenes(se::State& s) // NOLINT(readability-identifier-naming) { @@ -10227,6 +10227,7 @@ bool js_register_scene_Root(se::Object* obj) // NOLINT(readability-identifier-na cls->defineProperty("fps", _SE(js_scene_Root_getFps_asGetter), nullptr); cls->defineProperty("fixedFPS", _SE(js_scene_Root_getFixedFPS_asGetter), _SE(js_scene_Root_setFixedFPS_asSetter)); cls->defineProperty("useDeferredPipeline", _SE(js_scene_Root_isUsingDeferredPipeline_asGetter), nullptr); + cls->defineProperty("pipeline", _SE(js_scene_Root_getPipeline_asGetter), nullptr); cls->defineFunction("activeWindow", _SE(js_scene_Root_activeWindow)); cls->defineFunction("createCamera", _SE(js_scene_Root_createCamera)); cls->defineFunction("createScene", _SE(js_scene_Root_createScene)); @@ -10241,7 +10242,6 @@ bool js_register_scene_Root(se::Object* obj) // NOLINT(readability-identifier-na cls->defineFunction("frameMove", _SE(js_scene_Root_frameMove)); cls->defineFunction("getBatcher2D", _SE(js_scene_Root_getBatcher2D)); cls->defineFunction("getEventProcessor", _SE(js_scene_Root_getEventProcessor)); - cls->defineFunction("getPipeline", _SE(js_scene_Root_getPipeline)); cls->defineFunction("_initialize", _SE(js_scene_Root_initialize)); cls->defineFunction("onGlobalPipelineStateChanged", _SE(js_scene_Root_onGlobalPipelineStateChanged)); cls->defineFunction("resetCumulativeTime", _SE(js_scene_Root_resetCumulativeTime)); diff --git a/native/cocos/bindings/auto/jsb_scene_auto.h b/native/cocos/bindings/auto/jsb_scene_auto.h index 073b8b7dec..a7bbb24ed9 100644 --- a/native/cocos/bindings/auto/jsb_scene_auto.h +++ b/native/cocos/bindings/auto/jsb_scene_auto.h @@ -426,7 +426,6 @@ SE_DECLARE_FUNC(js_scene_Root_destroyWindows); SE_DECLARE_FUNC(js_scene_Root_frameMove); SE_DECLARE_FUNC(js_scene_Root_getBatcher2D); SE_DECLARE_FUNC(js_scene_Root_getEventProcessor); -SE_DECLARE_FUNC(js_scene_Root_getPipeline); SE_DECLARE_FUNC(js_scene_Root_initialize); SE_DECLARE_FUNC(js_scene_Root_onGlobalPipelineStateChanged); SE_DECLARE_FUNC(js_scene_Root_resetCumulativeTime); diff --git a/native/tools/tojs/scene.ini b/native/tools/tojs/scene.ini index 62b80b9432..f96753f77c 100644 --- a/native/tools/tojs/scene.ini +++ b/native/tools/tojs/scene.ini @@ -92,7 +92,7 @@ rename_functions = Root::[initialize=_initialize], Scene::[load=_load activate=_activate], Pass::[initPassFromTarget=_initPassFromTarget] -getter_setter = Root::[device:_device mainWindow curWindow tempWindow windows scenes cumulativeTime frameTime frameCount fps fixedFPS useDeferredPipeline/isUsingDeferredPipeline], +getter_setter = Root::[device:_device mainWindow curWindow tempWindow windows scenes cumulativeTime frameTime frameCount fps fixedFPS useDeferredPipeline/isUsingDeferredPipeline pipeline], RenderWindow::[width height framebuffer cameras swapchain], Pass::[root device shaderInfo localSetLayout program properties defines passIndex propertyIndex dynamics rootBufferDirty/isRootBufferDirty _rootBufferDirty/isRootBufferDirty/_setRootBufferDirty priority primitive stage phase rasterizerState depthStencilState blendState dynamicStates batchingScheme descriptorSet hash/getHashForJS pipelineLayout], PassInstance::[parent],