Align Universal renderer ownership with Unity SRP

This commit is contained in:
2026-04-26 22:43:22 +08:00
parent d4e0276b96
commit de64d9a698
11 changed files with 385 additions and 506 deletions

View File

@@ -45,6 +45,15 @@ The URP object model should be the center of future work:
- `ScriptableRenderPipelineAsset` owns pipeline defaults, renderer-data lists,
default renderer selection, camera policy, final-color policy, shadow policy,
and managed pipeline lifetime.
- `UniversalRenderPipelineAsset` is the public URP asset spine. It owns
`rendererDataList`, `defaultRendererIndex`, renderer-data synchronization,
runtime renderer cache release, camera renderer override resolution, and
`UniversalRenderPipeline` creation directly. Do not put another public
renderer-backed bridge layer between URP assets and SRP assets.
- `UniversalRenderPipeline` is the public URP pipeline object. It should route
stage support and stage recording to the selected `ScriptableRenderer`
through the owning `UniversalRenderPipelineAsset`, not through XCEngine-only
public base classes.
- `ScriptableRendererData` is the serialized renderer configuration. It owns
renderer feature lists, default feature creation, runtime invalidation, and
renderer instance rebuilds.
@@ -105,6 +114,10 @@ Guardrails:
- Do not reintroduce public managed wrappers for native private scene injection
points.
- Do not reintroduce public managed bridge classes such as
`RendererBackedRenderPipelineAsset`, `RendererBackedRenderPipeline`, or
`RendererDrivenRenderPipeline`. Renderer-backed behavior belongs inside the
Unity-facing URP asset/pipeline pair.
- Do not make `RenderPassEvent` or renderer blocks a thin alias for native
built-in pass order. They should describe URP scheduling semantics.
- Do not add managed APIs that only work by reaching into one built-in native
@@ -126,3 +139,8 @@ Guardrails:
scope. Public `ContextContainer` state is now shared across renderer passes
for the same stage, matching URP's frame-data mental model instead of
pass-local scratch data.
- Removed the non-Unity public renderer-backed bridge layer from the Universal
package. `UniversalRenderPipelineAsset` now derives directly from
`ScriptableRenderPipelineAsset`, owns renderer-data selection and runtime
resource lifecycle itself, and creates `UniversalRenderPipeline` directly.
The deleted bridge types must remain absent from the public API surface.