engine: sync editor rendering and ui changes

This commit is contained in:
2026-04-08 16:09:15 +08:00
parent 31756847ab
commit 162f1cc12e
153 changed files with 4454 additions and 2990 deletions

View File

@@ -81,7 +81,9 @@ TEST(ViewportRenderTargetsTest, BuildReuseQueryReflectsCurrentResourcePresence)
targets.objectIdTexture = reinterpret_cast<RHITexture*>(static_cast<uintptr_t>(0x5));
targets.objectIdView = reinterpret_cast<RHIResourceView*>(static_cast<uintptr_t>(0x6));
targets.objectIdShaderView = reinterpret_cast<RHIResourceView*>(static_cast<uintptr_t>(0x7));
targets.textureId = static_cast<ImTextureID>(static_cast<uintptr_t>(0x8));
targets.textureHandle.nativeHandle = 0x8;
targets.textureHandle.width = 1280;
targets.textureHandle.height = 720;
const auto query =
BuildViewportRenderTargetsReuseQuery(EditorViewportKind::Scene, targets, 1280, 720);
@@ -146,7 +148,9 @@ TEST(ViewportRenderTargetsTest, DestroyViewportRenderTargetsShutsDownAndClearsSt
targets.objectIdShaderView = objectIdShaderView;
targets.imguiCpuHandle.ptr = 123;
targets.imguiGpuHandle.ptr = 456;
targets.textureId = static_cast<ImTextureID>(static_cast<uintptr_t>(789));
targets.textureHandle.nativeHandle = 789;
targets.textureHandle.width = 640;
targets.textureHandle.height = 360;
targets.colorState = ResourceStates::RenderTarget;
targets.objectIdState = ResourceStates::PixelShaderResource;
targets.hasValidObjectIdFrame = true;
@@ -171,7 +175,9 @@ TEST(ViewportRenderTargetsTest, DestroyViewportRenderTargetsShutsDownAndClearsSt
EXPECT_EQ(targets.objectIdShaderView, nullptr);
EXPECT_EQ(targets.imguiCpuHandle.ptr, 0u);
EXPECT_EQ(targets.imguiGpuHandle.ptr, 0u);
EXPECT_EQ(targets.textureId, ImTextureID{});
EXPECT_EQ(targets.textureHandle.nativeHandle, 0u);
EXPECT_EQ(targets.textureHandle.width, 0u);
EXPECT_EQ(targets.textureHandle.height, 0u);
EXPECT_EQ(targets.colorState, ResourceStates::Common);
EXPECT_EQ(targets.objectIdState, ResourceStates::Common);
EXPECT_FALSE(targets.hasValidObjectIdFrame);