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

@@ -35,8 +35,12 @@ change.
contracts under `app/Core` and `app/Host/Interfaces`.
- `XCEditorCore` also does not consume the whole `editor/app` root privately.
Its implementation include paths enumerate concrete app module roots such as
`app/Composition`, `app/Features`, `app/Windowing`, `app/Rendering`,
`app/Scene`, `app/Services`, and `app/Support`.
`app/Composition`, `app/Features`, `app/Windowing`, `app/Scene`,
`app/Services`, and `app/Support`.
- Concrete `app/Rendering/**` implementation builds as the
`XCEditorCoreRendering` object library. `XCEditorCore` consumes those object
files, but it does not publish or privately widen its include surface back to
`app/Rendering`.
- `XCEditorCore` and `XCEditor` require
`XCENGINE_ENABLE_RENDERING_EDITOR_SUPPORT=ON`; the root build defaults that
support on when either the core library or app executable is enabled.
@@ -71,8 +75,9 @@ change.
state contracts, panel IDs, shared window type contracts, host window
geometry/metrics, frame transfer requests, the panel-facing service view,
the windowing-facing frame-services/shell-runtime contracts,
scene-viewport request contracts, workspace-panel runtime interface, and
utility-window runtime/descriptors.
scene-viewport request contracts, icon-service and viewport-runtime
contracts, workspace-panel runtime interface, and utility-window
runtime/descriptors.
- `app/Host/Interfaces/` contains neutral host-facing contracts used across
editor core and executable host code: editor window host interfaces,
render-runtime factories, UI texture hosts, viewport render hosts, host
@@ -86,7 +91,9 @@ change.
- `app/Windowing/` owns window instances, content controllers, lifecycle,
workspace synchronization, and utility-window creation.
- `app/Rendering/` owns built-in icons, viewport render targets, object
picking, scene viewport passes, and viewport render services.
picking, scene viewport passes, and viewport render services. It is the
concrete implementation side of Core-owned editor icon and viewport runtime
contracts.
- `app/Features/` contains user-facing panels and editor tools: Hierarchy,
Scene viewport, Inspector, Project, Console, Color Picker, and component UI.
- `app/Features/EditorWorkspacePanelRegistry.*` is the concrete workspace
@@ -115,6 +122,11 @@ change.
shared value contracts in `app/Core`. Do not add new public app contracts
under concrete `app/Windowing`, `app/Rendering`, `app/Host/Win32`,
`app/Host/D3D12`, or legacy `app/Platform` paths.
- `app/Composition/**` and `app/Features/**` may depend on
`app/Core/Assets/EditorIconService.h` and `app/Core/Viewport/**`, but they
must not include concrete `app/Rendering/**` headers such as
`Assets/BuiltInIcons.h`, `Viewport/ViewportHostService.h`, or
`Viewport/SceneViewportRenderService.h`.
- `app/Windowing/**` may depend on `app/Core/Windowing` contracts such as
`EditorFrameServices` and `EditorWorkspaceShellRuntime`, but it must not
include concrete `app/Composition/EditorContext.h` or
@@ -166,17 +178,20 @@ change.
`UIEditorWorkspaceController` every frame. A live controller writes mutations
through to the authoritative window workspace state; a copied controller is
only a preview.
- `EditorShellRuntime` owns per-window interactive runtime state: viewport host
service, built-in icons, the workspace panel runtime set, shell interaction
state/frame, splitter correction state, trace entries, draw composer,
interaction engine, hosted panel coordinator, and session coordinator.
- `EditorShellRuntime` owns per-window interactive runtime state: injected
editor icon and viewport-runtime services, the workspace panel runtime set,
shell interaction state/frame, splitter correction state, trace entries,
draw composer, interaction engine, hosted panel coordinator, and session
coordinator.
- `EditorWorkspaceShellRuntime` is the windowing-facing shell runtime contract.
`EditorShellRuntime` is the current concrete implementation, and
`Application` injects it through the content factory instead of letting
`app/Windowing/**` construct or name the concrete type directly.
- The workspace shell runtime factory passed into windowing is intentionally
zero-argument. `Application` composes the concrete workspace-panel runtime
set with `EditorShellRuntime`; `app/Windowing/**` must not accept or call
set, `CreateEditorIconService()`, and
`CreateEditorViewportRuntimeServices()` with `EditorShellRuntime`;
`app/Windowing/**` must not accept or call
`EditorWorkspacePanelRuntimeSetFactory`.
- `EditorWindowRuntimeController` owns the content controller, render runtime,
screenshot controller, title-bar logo texture, text measurer access, DPI
@@ -288,18 +303,27 @@ inside pure shell/widget code.
- Scene and Game are `ViewportShell` presentations. The Scene panel is the
active editor viewport implementation; Game is registered as a viewport panel
but is not equivalent to the runtime game view yet.
- `SceneViewportFeature` owns `SceneViewportController` and
`SceneViewportRenderService`.
- `ViewportHostService` is the per-window manager for viewport requests,
render-target allocation, retirement, fallback clearing, and dispatch to the
attached `ViewportRenderHost`.
- `SceneViewportRenderService` renders scene content through the engine
renderer and owns object-id picking state. Keep editor picking/render support
behind `XCENGINE_ENABLE_RENDERING_EDITOR_SUPPORT`.
- Core viewport contracts now live under `app/Core/Viewport/**`: shared
viewport frame/resource types, object-picking contracts, and the editor
scene/runtime service abstractions.
- `SceneViewportFeature` owns `SceneViewportController` and consumes the
injected `EditorSceneViewportRuntime` contract instead of constructing or
naming concrete rendering services.
- `ViewportHostService` is the concrete per-window implementation of
`EditorViewportRuntimeServices`. It manages viewport requests, render-target
allocation, retirement, fallback clearing, and dispatch to the attached
`ViewportRenderHost`.
- `SceneViewportRenderService` is the concrete `EditorSceneViewportRuntime`
implementation. It renders scene content through the engine renderer and
owns object-id picking state. Keep editor picking/render support behind
`XCENGINE_ENABLE_RENDERING_EDITOR_SUPPORT`.
- Core icon contracts now live under `app/Core/Assets/EditorIconService.h`.
`BuiltInIcons` is the concrete implementation, and scene/tool overlays must
resolve editor icons through that contract rather than probing
`editor/resources/Icons` directly.
- Scene viewport shader/resource paths are runtime data. Build them from the
startup/runtime repo root in `SceneViewportFeature`, pass them into
`SceneViewportRenderService`, and keep render passes free of compile-time
source-tree path discovery.
startup/runtime repo root inside the rendering runtime service and keep
render passes free of compile-time source-tree path discovery.
- D3D12 window rendering is behind the abstract
`Rendering::Host::EditorWindowRenderRuntime`; native startup surface data is
passed through the neutral
@@ -317,6 +341,10 @@ inside pure shell/widget code.
`EditorWorkspacePanel` adapter interface; do not include concrete feature
panel headers from `EditorShellRuntime`, `EditorShellHostedPanelCoordinator`,
`EditorShellDrawComposer`, or `EditorShellSessionCoordinator`.
- Add new icon/viewport cross-layer contracts under `app/Core/Assets` or
`app/Core/Viewport`. Keep concrete texture loading, render-target ownership,
viewport host wiring, and scene viewport rendering in `app/Rendering/**`,
then inject those implementations from `Application`.
- Add new workspace panels by updating the panel ID constants, panel registry,
default workspace model, shell presentation, workspace panel runtime adapter,
and command/menu entries together.
@@ -352,6 +380,10 @@ inside pure shell/widget code.
`app/Host/Interfaces`, `include`, and engine headers;
implementation files use explicit module roots instead of the app-wide
compatibility root.
- Concrete rendering stays behind the `XCEditorCoreRendering` object library.
`XCEditorCore` consumes the object files, while Composition/Features/Core
continue to see only `app/Core` contracts and never gain an `app/Rendering`
include root.
- App-facing unit tests follow the same rule. `editor_app_core_tests` uses
explicit module include roots and must not regain the whole `editor/app`
root to make stale tests compile.
@@ -362,6 +394,11 @@ inside pure shell/widget code.
- `XCEditor` is the thin executable host that wires `XCEditorCore` to concrete
Win32 and D3D12 implementations. Do not move concrete platform/render host
code into `XCEditorCore` without first introducing neutral host contracts.
- `Application` is also the composition root for concrete editor icon and
viewport runtime services. It wires `CreateEditorIconService()` and
`CreateEditorViewportRuntimeServices()` into
`CreateEditorWorkspaceShellRuntime(...)` so `app/Composition/**` and
`app/Features/**` do not take concrete `app/Rendering/**` dependencies.
- `app/Core/Windowing/EditorFrameServices.h` and
`app/Core/Windowing/EditorWorkspaceShellRuntime.h` are the current
composition-to-windowing contract boundary. `EditorContext` and
@@ -436,7 +473,11 @@ inside pure shell/widget code.
- `editor/app/Host/Win32/Windowing/EditorWindowMessageDispatcher.cpp`
- `editor/app/Host/Interfaces/EditorWindowRenderRuntime.h`
- `editor/app/Host/Interfaces/EditorWindowHostInterfaces.h`
- `editor/app/Core/Assets/EditorIconService.h`
- `editor/app/Core/Viewport/EditorViewportRuntimeServices.h`
- `editor/app/Core/Windowing/EditorWindowTransferRequests.h`
- `editor/app/Rendering/Assets/EditorIconServiceFactory.h`
- `editor/app/Rendering/Viewport/EditorViewportRuntimeServicesFactory.h`
- `editor/app/Rendering/Viewport/ViewportHostService.h`
- `tests/UI/Editor/unit/CMakeLists.txt`
- `tests/UI/Editor/smoke/CMakeLists.txt`
@@ -529,8 +570,18 @@ ownership rule.
`app/Host/Win32/Resources`, so `XCEditorCore` no longer consumes
`app/Bootstrap` or Win32 resource helpers to initialize built-in icons,
title-bar branding, or screenshot output roots.
- Scene viewport shader paths are now injected at runtime from
`SceneViewportFeature` into `SceneViewportRenderService` and its pass bundle.
- Concrete editor icons and scene viewport runtime services are now hidden
behind `Core/Assets/EditorIconService.h` and `Core/Viewport/**` contracts.
`Application` injects `CreateEditorIconService()` and
`CreateEditorViewportRuntimeServices()` into `EditorShellRuntime`, so
`app/Composition/**` and `app/Features/**` no longer include concrete
`app/Rendering/**` headers.
- `XCEditorCoreRendering` now builds `app/Rendering/**` as a dedicated object
library. That keeps concrete rendering implementation in the core product
build without reopening `app/Rendering` as an include root for
Composition/Features/Core.
- Scene viewport shader paths are now injected at runtime by the viewport
runtime service into `SceneViewportRenderService` and its pass bundle.
Grid/selection passes no longer infer source-tree shader paths through
`XCUIEDITOR_REPO_ROOT` or `__FILE__`.
- `Application` no longer resolves the editor repo root from a compile-time