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

@@ -490,6 +490,44 @@ TEST(AssetImportService_Test, ClearLibraryAndReimportAllAssetsManageArtifactsExp
fs::remove_all(projectRoot);
}
TEST(AssetImportService_Test, OnlyShaderAuthoringFilesAreImportableShaderSources) {
namespace fs = std::filesystem;
AssetImportService importService;
importService.Initialize();
const fs::path projectRoot = fs::temp_directory_path() / "xc_asset_import_service_shader_source_scope";
const fs::path assetsDir = projectRoot / "Assets";
const fs::path shaderPath = assetsDir / "runtime.shader";
const fs::path includePath = assetsDir / "shared.hlsl";
fs::remove_all(projectRoot);
fs::create_directories(assetsDir);
{
std::ofstream shaderFile(shaderPath);
ASSERT_TRUE(shaderFile.is_open());
shaderFile << "Shader \"Test/Runtime\" { SubShader { Pass { HLSLPROGRAM #pragma vertex MainVS #pragma fragment MainPS float4 MainVS() : SV_POSITION { return 0; } float4 MainPS() : SV_TARGET { return 1; } ENDHLSL } } }";
}
{
std::ofstream includeFile(includePath);
ASSERT_TRUE(includeFile.is_open());
includeFile << "float4 SharedHelper() { return 1; }";
}
importService.SetProjectRoot(projectRoot.string().c_str());
ResourceType shaderType = ResourceType::Unknown;
EXPECT_TRUE(importService.TryGetImportableResourceType("Assets/runtime.shader", shaderType));
EXPECT_EQ(shaderType, ResourceType::Shader);
ResourceType includeType = ResourceType::Unknown;
EXPECT_FALSE(importService.TryGetImportableResourceType("Assets/shared.hlsl", includeType));
EXPECT_EQ(includeType, ResourceType::Unknown);
importService.Shutdown();
fs::remove_all(projectRoot);
}
TEST(AssetImportService_Test, ImportStatusTracksExplicitOperationsAndRefreshCleanup) {
namespace fs = std::filesystem;