refactor(srp): move render scene setup into managed urp

This commit is contained in:
2026-04-21 03:09:08 +08:00
parent db08861183
commit 8e4576de95
13 changed files with 388 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
# SRP Universal Render Scene Setup Policy Managed Ownership Plan 2026-04-21
## Goal
Move render-scene setup policy selection out of native `RenderPipeline` hardcoded defaults and into managed URP renderer-data ownership.
This stage still keeps the actual `RenderSceneData` population native.
It only makes managed URP explicitly choose which native scene-setup policy asset key should be used.
## Why This Stage
The current SRP split already moved:
1. renderer selection into managed URP;
2. builtin scene feature ownership into managed renderer features;
3. shadow planning policy into managed URP asset ownership;
4. shadow execution policy into managed URP renderer-data ownership;
5. shadow-caster standalone pass selection into managed URP renderer-data ownership.
But `RenderPipeline::ConfigureRenderSceneData()` still directly hardcodes:
1. global shader keyword setup;
2. environment / skybox setup.
That means managed URP still cannot explicitly own how extracted scene data is finalized before the renderer consumes it.
## Scope
Included:
1. add a native registry for render-scene setup policies;
2. add managed asset / renderer-data API for render-scene setup policy asset keys;
3. let Mono runtime resolve those keys from managed pipeline assets;
4. let `ScriptableRenderPipelineHost` use managed-selected render-scene setup policy keys;
5. make `UniversalRendererData` explicitly own the builtin render-scene setup policy key;
6. rebuild `XCEditor` and run old editor smoke.
Not included:
1. exposing mutable `RenderSceneData` editing directly to C#;
2. custom managed skybox authoring APIs;
3. custom global shader keyword authoring APIs;
4. changing render-scene extraction itself.
## Acceptance
This stage is complete when:
1. managed URP explicitly owns render-scene setup policy selection;
2. native host no longer blindly applies the default render-scene setup for managed pipelines;
3. builtin scene setup still works for the default URP renderer;
4. `XCEditor` build and old editor smoke both pass.
## Result
Completed on 2026-04-21.
Validation:
1. `cmake --build . --config Debug --target XCEditor` passed;
2. old editor smoke passed with `editor/bin/Debug/XCEngine.exe`;
3. `editor/bin/Debug/editor.log` recorded `SceneReady` at `2026-04-21 03:07:29`.