refactor(srp): move shadow caster stage selection into managed urp

- add standalone pass asset factories for camera frame stages\n- let managed pipeline assets declare stage pass asset keys\n- make universal renderer data explicitly own the builtin shadow caster stage
This commit is contained in:
2026-04-21 02:38:56 +08:00
parent bfc4b90ce6
commit e2b2df4c8f
16 changed files with 544 additions and 14 deletions

View File

@@ -0,0 +1,47 @@
# SRP Universal Shadow Caster Stage Managed Ownership Plan 2026-04-21
## Goal
Move `CameraFrameStage::ShadowCaster` pass selection out of the native host hardcode and into managed URP ownership.
This stage does **not** move shadow rasterization itself into C#.
It only makes managed URP explicitly declare which native shadow-caster pass asset it wants to use.
## Why This Stage
The current managed URP already owns:
1. renderer selection;
2. main-scene builtin feature ownership;
3. shadow enable / planning defaults.
But the actual `ShadowCaster` standalone stage is still installed in native host code through a hardcoded `BuiltinShadowCasterPass`.
That means shadow stage ownership is still not aligned with the SRP/URP boundary.
## Scope
Included:
1. add a native registry/factory for camera-frame standalone pass assets;
2. let managed `ScriptableRenderPipelineAsset` expose standalone pass asset keys by stage;
3. let `RendererBackedRenderPipelineAsset` route that decision through selected renderer data;
4. make `UniversalRendererData` explicitly declare the builtin shadow-caster pass asset key;
5. let `ScriptableRenderPipelineHost` resolve contextual standalone passes from managed asset runtime instead of hardcoding shadow caster;
6. rebuild `XCEditor` and run old editor smoke.
Not included:
1. managed shadow raster pass recording;
2. cascades;
3. shadow atlas packing;
4. editor UI for standalone pass selection.
## Acceptance
This stage is complete when:
1. managed URP explicitly owns the `ShadowCaster` standalone pass selection;
2. native host no longer hardcodes shadow caster for managed pipelines;
3. builtin fallback pipeline still keeps depth-only / object-id / shadow-caster working;
4. `XCEditor` build and old editor smoke both pass.