checkpoint(new_editor): native d3d12 ui path

Key node 1: move main-window UI presentation onto the D3D12 render loop with native UI renderer, text system, and texture host.

Key node 2: wire frame timing/FPS display, window runtime, swapchain presentation, and native screenshot capture around the new path.

Key node 3: carry editor shell/workspace/viewport/panel interaction updates needed by the new renderer and detached window flow.

Key node 4: pump async resource loads and scene bridge follow-up needed for scene content visibility in new_editor.
This commit is contained in:
2026-04-21 20:49:18 +08:00
parent a779b04dba
commit 6e9265e92e
53 changed files with 5330 additions and 858 deletions

View File

@@ -49,7 +49,6 @@ void EditorShellRuntime::Initialize(
m_projectPanel.SetBuiltInIcons(&m_builtInIcons);
m_projectPanel.SetTextMeasurer(&textMeasurer);
m_hierarchyPanel.Initialize();
m_projectPanel.Initialize(repoRoot);
}
void EditorShellRuntime::AttachViewportWindowRenderer(Ports::ViewportRenderPort& renderer) {
@@ -257,36 +256,120 @@ void AppendShellPopups(
namespace XCEngine::UI::Editor::App {
using ::XCEngine::UI::UIDrawList;
using ::XCEngine::UI::UIDrawData;
template<typename AppendFn>
void AppendDrawPacket(
UIDrawData& drawData,
std::string debugName,
AppendFn&& appendFn) {
UIDrawList drawList(std::move(debugName));
appendFn(drawList);
if (!drawList.Empty()) {
drawData.AddDrawList(std::move(drawList));
}
}
void EditorShellRuntime::RenderRequestedViewports(
const ::XCEngine::Rendering::RenderContext& renderContext) {
m_viewportHostService.RenderRequestedViewports(renderContext);
}
void EditorShellRuntime::Append(UIDrawList& drawList) const {
void EditorShellRuntime::Append(UIDrawData& drawData) const {
const auto& metrics = ResolveUIEditorShellInteractionMetrics();
const auto& palette = ResolveUIEditorShellInteractionPalette();
const UIEditorShellComposeModel shellComposeModel =
BuildShellComposeModelFromFrame(m_shellFrame);
AppendUIEditorShellCompose(
drawList,
m_shellFrame.shellFrame,
shellComposeModel,
m_shellInteractionState.composeState,
palette.shellPalette,
metrics.shellMetrics,
&m_builtInIcons);
m_consolePanel.Append(drawList);
m_colorPickerPanel.Append(drawList);
m_hierarchyPanel.Append(drawList);
m_inspectorPanel.Append(drawList);
m_projectPanel.Append(drawList);
m_sceneViewportFeature.Append(drawList);
AppendUIEditorShellComposeOverlay(
drawList,
m_shellFrame.shellFrame,
palette.shellPalette,
metrics.shellMetrics);
AppendShellPopups(drawList, m_shellFrame, palette, metrics);
AppendDrawPacket(
drawData,
"XCEditorShell.Compose.Base",
[&](UIDrawList& drawList) {
AppendUIEditorShellComposeBase(
drawList,
m_shellFrame.shellFrame,
shellComposeModel,
m_shellInteractionState.composeState,
palette.shellPalette,
metrics.shellMetrics,
&m_builtInIcons);
});
AppendDrawPacket(
drawData,
"XCEditorShell.Compose.Workspace",
[&](UIDrawList& drawList) {
AppendUIEditorWorkspaceCompose(
drawList,
m_shellFrame.workspaceInteractionFrame.composeFrame,
palette.shellPalette.dockHostPalette,
metrics.shellMetrics.dockHostMetrics,
palette.shellPalette.viewportPalette,
metrics.shellMetrics.viewportMetrics,
UIEditorWorkspaceComposeAppendOptions{
true,
false
});
});
AppendDrawPacket(
drawData,
"XCEditorShell.Compose.ViewportTextures",
[&](UIDrawList& drawList) {
AppendUIEditorWorkspaceComposeViewportTextures(
drawList,
m_shellFrame.workspaceInteractionFrame.composeFrame,
palette.shellPalette.viewportPalette);
});
AppendDrawPacket(
drawData,
"XCEditorShell.Compose.StatusBar",
[&](UIDrawList& drawList) {
AppendUIEditorShellComposeStatusBar(
drawList,
m_shellFrame.shellFrame,
shellComposeModel,
m_shellInteractionState.composeState,
palette.shellPalette,
metrics.shellMetrics);
});
AppendDrawPacket(
drawData,
"XCEditorPanel.Console",
[&](UIDrawList& drawList) { m_consolePanel.Append(drawList); });
AppendDrawPacket(
drawData,
"XCEditorPanel.ColorPicker",
[&](UIDrawList& drawList) { m_colorPickerPanel.Append(drawList); });
AppendDrawPacket(
drawData,
"XCEditorPanel.Hierarchy",
[&](UIDrawList& drawList) { m_hierarchyPanel.Append(drawList); });
AppendDrawPacket(
drawData,
"XCEditorPanel.Inspector",
[&](UIDrawList& drawList) { m_inspectorPanel.Append(drawList); });
AppendDrawPacket(
drawData,
"XCEditorPanel.Project",
[&](UIDrawList& drawList) { m_projectPanel.Append(drawList); });
AppendDrawPacket(
drawData,
"XCEditorPanel.SceneOverlay",
[&](UIDrawList& drawList) { m_sceneViewportFeature.Append(drawList); });
AppendDrawPacket(
drawData,
"XCEditorShell.Compose.Overlay",
[&](UIDrawList& drawList) {
AppendUIEditorShellComposeOverlay(
drawList,
m_shellFrame.workspaceInteractionFrame.composeFrame,
palette.shellPalette,
metrics.shellMetrics);
});
AppendDrawPacket(
drawData,
"XCEditorShell.Popups",
[&](UIDrawList& drawList) {
AppendShellPopups(drawList, m_shellFrame, palette, metrics);
});
}
} // namespace XCEngine::UI::Editor::App
@@ -664,7 +747,6 @@ void ApplyViewportFramesToShellFrame(
};
applyToViewportFrames(shellFrame.workspaceInteractionFrame.composeFrame.viewportFrames);
applyToViewportFrames(shellFrame.shellFrame.workspaceFrame.viewportFrames);
}
} // namespace XCEngine::UI::Editor::App