refactor(new_editor/app): reorganize host structure and add smoke test

This commit is contained in:
2026-04-15 08:24:06 +08:00
parent 3617b4840b
commit 9e5954cf0a
235 changed files with 11157 additions and 10028 deletions

View File

@@ -0,0 +1,63 @@
#include "ViewportRenderTargets.h"
namespace XCEngine::UI::Editor::App {
ViewportResourceReuseQuery BuildViewportRenderTargetsReuseQuery(
ViewportKind kind,
const ViewportRenderTargets& targets,
std::uint32_t requestedWidth,
std::uint32_t requestedHeight) {
ViewportResourceReuseQuery query = {};
query.kind = kind;
query.width = targets.width;
query.height = targets.height;
query.requestedWidth = requestedWidth;
query.requestedHeight = requestedHeight;
query.resources.hasColorTexture = targets.colorTexture != nullptr;
query.resources.hasColorView = targets.colorView != nullptr;
query.resources.hasDepthTexture = targets.depthTexture != nullptr;
query.resources.hasDepthView = targets.depthView != nullptr;
query.resources.hasDepthShaderView = targets.depthShaderView != nullptr;
query.resources.hasObjectIdTexture = targets.objectIdTexture != nullptr;
query.resources.hasObjectIdDepthTexture = targets.objectIdDepthTexture != nullptr;
query.resources.hasObjectIdDepthView = targets.objectIdDepthView != nullptr;
query.resources.hasObjectIdView = targets.objectIdView != nullptr;
query.resources.hasObjectIdShaderView = targets.objectIdShaderView != nullptr;
query.resources.hasSelectionMaskTexture = targets.selectionMaskTexture != nullptr;
query.resources.hasSelectionMaskView = targets.selectionMaskView != nullptr;
query.resources.hasSelectionMaskShaderView = targets.selectionMaskShaderView != nullptr;
query.resources.hasTextureDescriptor = targets.textureHandle.IsValid();
return query;
}
::XCEngine::Rendering::RenderSurface BuildViewportColorSurface(
const ViewportRenderTargets& targets) {
return BuildViewportRenderSurface(
targets.width,
targets.height,
targets.colorView,
targets.depthView,
targets.colorState);
}
::XCEngine::Rendering::RenderSurface BuildViewportObjectIdSurface(
const ViewportRenderTargets& targets) {
return BuildViewportRenderSurface(
targets.width,
targets.height,
targets.objectIdView,
targets.objectIdDepthView,
targets.objectIdState);
}
::XCEngine::Rendering::RenderSurface BuildViewportSelectionMaskSurface(
const ViewportRenderTargets& targets) {
return BuildViewportRenderSurface(
targets.width,
targets.height,
targets.selectionMaskView,
targets.depthView,
targets.selectionMaskState);
}
} // namespace XCEngine::UI::Editor::App