Refactor editor rendering contracts

This commit is contained in:
2026-04-28 02:57:49 +08:00
parent 3bc0cfcf08
commit b1ae6c462d
47 changed files with 798 additions and 377 deletions

View File

@@ -48,9 +48,13 @@ incomplete:
code to load built-in PNGs, title-bar branding, or executable-relative
capture output paths.
- Scene viewport shader paths now flow through runtime initialization. The
scene viewport feature builds the paths from the runtime repo root and
viewport runtime service builds the paths from the runtime repo root and
injects them into the render service/pass bundle instead of letting render
passes infer source-tree paths from a compile-time repo-root macro.
- Editor icon and viewport runtime contracts now live under
`editor/app/Core/Assets` and `editor/app/Core/Viewport`. Concrete icon
loading, viewport host services, scene viewport rendering, render targets,
and object-id picking stay under `editor/app/Rendering`.
- Feature panels no longer use `Composition/EditorContext.h` directly. The
app-core and app feature/viewport test targets now exercise `XCEditorCore`
outside the executable host.
@@ -105,9 +109,13 @@ Completed boundary cuts:
- The private `editor/app` compatibility include root is gone from
`XCEditorCore` and `XCEditor`. App implementation files now include through
explicit module roots such as `app/Composition`, `app/Features`,
`app/Windowing`, `app/Rendering`, `app/Scene`, `app/Services`,
`app/Support`, `app/Host/Interfaces`, `app/Host/Win32`, and
`app/Host/D3D12`; only executable-host code consumes `app/Bootstrap`.
`app/Windowing`, `app/Scene`, `app/Services`, `app/Support`,
`app/Host/Interfaces`, `app/Host/Win32`, and `app/Host/D3D12`; only
executable-host code consumes `app/Bootstrap`.
- Concrete `app/Rendering/**` files now build through the
`XCEditorCoreRendering` object library. `XCEditorCore` consumes the object
files but does not expose `app/Rendering` to Composition, Features, or Core
sources.
- `editor_app_core_tests` now links `XCEditorCore` directly and uses explicit
app module include roots. Its initial suite covers host command routing,
project runtime, shell asset validation, project browser model, hierarchy
@@ -143,11 +151,13 @@ The refactor should converge on this shape:
```text
editor/app/
Core/
Assets/
Commands/
Panels/
Scene/
State/
UtilityWindows/
Viewport/
Windowing/
WorkspacePanels/
@@ -175,6 +185,10 @@ editor/app/
Win32/
D3D12/
Rendering/
Assets/
Viewport/
Bootstrap/
Support/
```
@@ -183,6 +197,12 @@ This is a convergence target, not a requirement to move every file at once.
The first cut should only move contracts that are already acting as global app
interfaces.
Same domain names under different layers are acceptable only when the layer
meaning is explicit and build-checked: `Core/Viewport` is the shared contract
surface, while `Rendering/Viewport` is the concrete implementation. If a
Composition or Feature file needs a viewport concept, it should include the
Core contract, not the concrete Rendering path.
## Dependency Rules
The final direction should be:
@@ -197,6 +217,12 @@ Within `XCEditorCore`:
`XCUIEditor`.
- `Composition` must not include concrete feature panel headers.
- `Features` may depend on `Core`, `Services`, and `XCUIEditor`.
- `Composition` and `Features` must not include concrete `app/Rendering/**`
headers. They should use `Core/Assets/EditorIconService.h` and
`Core/Viewport/**` contracts.
- `app/Rendering/**` may depend on `Core`, `Host/Interfaces`, `XCUIEditor`,
and engine renderer/editor support. It implements Core contracts and is wired
from `Application`.
- `Services` must not depend on `Features`.
- `State` must not depend on `Composition`.
- `Windowing` may depend on `Core`, `Composition` interfaces, and
@@ -458,7 +484,7 @@ not a rendering implementation detail. Keep future scene-to-viewport request
values under `Core/Scene` so scene services can build requests without taking
an `app/Rendering/**` include dependency.
- Scene viewport shader paths are runtime configuration now. Build them from
the runtime repo root in `SceneViewportFeature`, inject them into
the runtime repo root in the viewport runtime service, inject them into
`SceneViewportRenderService`, and keep grid/selection render passes from
inferring source-tree paths with compile-time macros or `__FILE__`.
@@ -554,8 +580,25 @@ Completed cuts:
scene viewport request contract without depending on `app/Rendering/**`, and
`editor_app_core_tests` no longer needs the app rendering include root to
validate scene runtime behavior.
- Scene viewport shader/resource paths are now injected from
`SceneViewportFeature` into `SceneViewportRenderService` and
- Editor icon contracts now live under
`editor/app/Core/Assets/EditorIconService.h`. `BuiltInIcons` remains the
concrete `editor/app/Rendering` implementation, and panels/tool overlays
resolve icons through the contract instead of loading resource files or
naming concrete icon storage.
- Viewport runtime contracts now live under `editor/app/Core/Viewport/**`.
`SceneViewportFeature` consumes `EditorSceneViewportRuntime`, while
`ViewportHostService` and `SceneViewportRenderService` stay concrete
rendering implementations behind `CreateEditorViewportRuntimeServices()`.
- `Application` injects `CreateEditorIconService()` and
`CreateEditorViewportRuntimeServices()` into `EditorShellRuntime`, making
the executable startup path the only place that names those concrete
rendering factories.
- `app/Rendering/**` now builds as `XCEditorCoreRendering`, a dedicated object
library consumed by `XCEditorCore`. This keeps rendering behavior in the
product core while preventing Composition/Features/Core from regaining an
`app/Rendering` include root.
- Scene viewport shader/resource paths are now injected from the viewport
runtime service into `SceneViewportRenderService` and
`SceneViewportRenderPassBundle`. The concrete grid and selection-outline
passes no longer depend on `XCUIEDITOR_REPO_ROOT` or `__FILE__` source-tree
fallback logic to find editor shaders.
@@ -615,6 +658,8 @@ The refactor is complete when:
- `XCEditor` executable source is limited to host startup and concrete
platform/render backend wiring.
- `Composition` no longer includes concrete feature panel headers.
- `Composition` and `Features` no longer include concrete `app/Rendering/**`
headers; icon and viewport use flows through Core contracts.
- `Windowing` no longer includes concrete composition runtime/state headers;
it depends on `Core/Windowing` composition interfaces instead.
- `Services` no longer include `Features/**`.