chore: checkpoint current workspace changes

This commit is contained in:
2026-04-11 22:14:02 +08:00
parent 3e55f8c204
commit 8848cfd958
227 changed files with 34027 additions and 6711 deletions

View File

@@ -86,6 +86,16 @@ const char* GetDiagnosticModeName(DiagnosticMode mode) {
}
}
const char* GetGoldenFileName(DiagnosticMode mode) {
switch (mode) {
case DiagnosticMode::Original: return "GT.ppm";
case DiagnosticMode::NoShadows: return "GT.no_shadows.ppm";
case DiagnosticMode::ForwardLit: return "GT.forward_lit.ppm";
case DiagnosticMode::Unlit: return "GT.unlit.ppm";
default: return "GT.ppm";
}
}
std::unordered_set<std::string> GetIsolationObjectNames() {
std::unordered_set<std::string> result;
const char* value = std::getenv("XC_NAHIDA_DIAG_ONLY");
@@ -713,6 +723,8 @@ TEST_P(NahidaPreviewSceneTest, RenderNahidaPreviewScene) {
RHISwapChain* swapChain = GetSwapChain();
ASSERT_NE(commandQueue, nullptr);
ASSERT_NE(swapChain, nullptr);
const DiagnosticMode diagnosticMode = GetDiagnosticMode();
const char* goldenFileName = GetGoldenFileName(diagnosticMode);
for (int frameIndex = 0; frameIndex <= kWarmupFrames; ++frameIndex) {
if (frameIndex > 0) {
@@ -730,12 +742,12 @@ TEST_P(NahidaPreviewSceneTest, RenderNahidaPreviewScene) {
ASSERT_EQ(image.width, kFrameWidth);
ASSERT_EQ(image.height, kFrameHeight);
const std::filesystem::path gtPath = ResolveRuntimePath("GT.ppm");
const std::filesystem::path gtPath = ResolveRuntimePath(goldenFileName);
if (!std::filesystem::exists(gtPath)) {
GTEST_SKIP() << "GT.ppm missing, screenshot captured for manual review: " << kD3D12Screenshot;
GTEST_SKIP() << goldenFileName << " missing, screenshot captured for manual review: " << kD3D12Screenshot;
}
ASSERT_TRUE(CompareWithGoldenTemplate(kD3D12Screenshot, "GT.ppm", 10.0f));
ASSERT_TRUE(CompareWithGoldenTemplate(kD3D12Screenshot, goldenFileName, 10.0f));
break;
}