Fixes
Some checks failed
CI / React UI Build (push) Successful in 38s
CI / Native Windows Build And Tests (push) Failing after 3m0s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
2026-05-22 14:43:03 +10:00
parent 084e60cbe0
commit 0b6a2300ea
47 changed files with 169 additions and 80 deletions

View File

@@ -40,18 +40,18 @@ add_video_shader_test(RenderCadenceCompositorRuntimeShaderParamsTests
)
add_video_shader_test(RenderCadenceCompositorRuntimeLayerModelTests
"${SRC_DIR}/runtime/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/RuntimeLayerModel.cpp"
"${SRC_DIR}/runtime/RuntimeLayerReload.cpp"
"${SRC_DIR}/runtime/RuntimeLayerSnapshot.cpp"
"${SRC_DIR}/runtime/RuntimeLayerStateRestore.cpp"
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/RuntimeParameterUtils.cpp"
"${SRC_DIR}/runtime/RuntimeTextTextureComposer.cpp"
"${SRC_DIR}/runtime/SupportedShaderCatalog.cpp"
"${SRC_DIR}/runtime/text/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/text/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/text/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/text/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerModel.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerReload.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerSnapshot.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerStateRestore.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeParameterUtils.cpp"
"${SRC_DIR}/runtime/text/RuntimeTextTextureComposer.cpp"
"${SRC_DIR}/runtime/catalog/SupportedShaderCatalog.cpp"
"${SRC_DIR}/shader/ShaderManifestAssets.cpp"
"${SRC_DIR}/shader/ShaderManifestParameters.cpp"
"${SRC_DIR}/shader/ShaderManifestParser.cpp"
@@ -61,17 +61,17 @@ add_video_shader_test(RenderCadenceCompositorRuntimeLayerModelTests
add_video_shader_test(RuntimeStatePersistenceTests
"${SRC_DIR}/logging/Logger.cpp"
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/RuntimeStatePersistence.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeStatePersistence.cpp"
"${TEST_DIR}/RuntimeStatePersistenceTests.cpp"
)
add_video_shader_test(FontAtlasBuilderTests
"${SRC_DIR}/runtime/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/text/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/text/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/text/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/text/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/shader/ShaderManifestAssets.cpp"
"${SRC_DIR}/shader/ShaderManifestParameters.cpp"
"${SRC_DIR}/shader/ShaderManifestParser.cpp"
@@ -80,12 +80,12 @@ add_video_shader_test(FontAtlasBuilderTests
)
add_video_shader_test(RenderCadenceCompositorSupportedShaderCatalogTests
"${SRC_DIR}/runtime/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/SupportedShaderCatalog.cpp"
"${SRC_DIR}/runtime/text/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/text/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/text/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/text/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/runtime/catalog/SupportedShaderCatalog.cpp"
"${SRC_DIR}/shader/ShaderManifestAssets.cpp"
"${SRC_DIR}/shader/ShaderManifestParameters.cpp"
"${SRC_DIR}/shader/ShaderManifestParser.cpp"
@@ -97,18 +97,18 @@ add_video_shader_test(RenderCadenceCompositorRuntimeStateJsonTests
"${SRC_DIR}/app/AppConfig.cpp"
"${SRC_DIR}/app/AppConfigProvider.cpp"
"${SRC_DIR}/json/JsonWriter.cpp"
"${SRC_DIR}/runtime/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/RuntimeLayerModel.cpp"
"${SRC_DIR}/runtime/RuntimeLayerReload.cpp"
"${SRC_DIR}/runtime/RuntimeLayerSnapshot.cpp"
"${SRC_DIR}/runtime/RuntimeLayerStateRestore.cpp"
"${SRC_DIR}/runtime/RuntimeParameterUtils.cpp"
"${SRC_DIR}/runtime/RuntimeTextTextureComposer.cpp"
"${SRC_DIR}/runtime/SupportedShaderCatalog.cpp"
"${SRC_DIR}/runtime/text/FontAtlasBuilder.cpp"
"${SRC_DIR}/runtime/text/FontAtlasImageLoader.cpp"
"${SRC_DIR}/runtime/text/FontAtlasMetadata.cpp"
"${SRC_DIR}/runtime/text/FontAtlasProcess.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerModel.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerReload.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerSnapshot.cpp"
"${SRC_DIR}/runtime/layers/RuntimeLayerStateRestore.cpp"
"${SRC_DIR}/runtime/state/RuntimeParameterUtils.cpp"
"${SRC_DIR}/runtime/text/RuntimeTextTextureComposer.cpp"
"${SRC_DIR}/runtime/catalog/SupportedShaderCatalog.cpp"
"${SRC_DIR}/shader/ShaderManifestAssets.cpp"
"${SRC_DIR}/shader/ShaderManifestParameters.cpp"
"${SRC_DIR}/shader/ShaderManifestParser.cpp"
@@ -123,7 +123,7 @@ add_video_shader_test(RenderCadenceCompositorHttpControlServerTests
"${SRC_DIR}/control/http/HttpControlServerWebSocket.cpp"
"${SRC_DIR}/json/JsonWriter.cpp"
"${SRC_DIR}/logging/Logger.cpp"
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${TEST_DIR}/RenderCadenceCompositorHttpControlServerTests.cpp"
)
target_link_libraries(RenderCadenceCompositorHttpControlServerTests PRIVATE Ws2_32)
@@ -131,23 +131,23 @@ target_link_libraries(RenderCadenceCompositorHttpControlServerTests PRIVATE Ws2_
add_video_shader_test(RenderCadenceCompositorAppConfigProviderTests
"${SRC_DIR}/app/AppConfig.cpp"
"${SRC_DIR}/app/AppConfigProvider.cpp"
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${TEST_DIR}/RenderCadenceCompositorAppConfigProviderTests.cpp"
)
add_video_shader_test(RuntimeJsonTests
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${TEST_DIR}/RuntimeJsonTests.cpp"
)
add_video_shader_test(RuntimeParameterUtilsTests
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/RuntimeParameterUtils.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeParameterUtils.cpp"
"${TEST_DIR}/RuntimeParameterUtilsTests.cpp"
)
add_video_shader_test(ShaderPackageRegistryTests
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/shader/ShaderManifestAssets.cpp"
"${SRC_DIR}/shader/ShaderManifestParameters.cpp"
"${SRC_DIR}/shader/ShaderManifestParser.cpp"
@@ -156,7 +156,7 @@ add_video_shader_test(ShaderPackageRegistryTests
)
add_video_shader_test(ShaderSlangValidationTests
"${SRC_DIR}/runtime/RuntimeJson.cpp"
"${SRC_DIR}/runtime/state/RuntimeJson.cpp"
"${SRC_DIR}/shader/ShaderCompiler.cpp"
"${SRC_DIR}/shader/ShaderManifestAssets.cpp"
"${SRC_DIR}/shader/ShaderManifestParameters.cpp"

View File

@@ -32,17 +32,34 @@ std::filesystem::path RepoRoot()
return std::filesystem::current_path();
}
bool HasBundledExecutable(std::filesystem::path& executablePath)
{
return RenderCadenceCompositor::FontAtlasBuilder::FindMsdfAtlasGenExecutable(RepoRoot(), executablePath);
}
bool IsMsdfAtlasGenToolError(const std::string& error)
{
return error.find("msdf-atlas-gen") != std::string::npos;
}
void TestFindsBundledExecutable()
{
std::filesystem::path executablePath;
Expect(
RenderCadenceCompositor::FontAtlasBuilder::FindMsdfAtlasGenExecutable(RepoRoot(), executablePath),
HasBundledExecutable(executablePath),
"bundled msdf-atlas-gen executable is found");
Expect(std::filesystem::exists(executablePath), "bundled msdf-atlas-gen executable exists");
}
void TestBuildsTextOverlayFontAtlas()
{
std::filesystem::path executablePath;
if (!HasBundledExecutable(executablePath))
{
std::cout << "SKIP: msdf-atlas-gen executable is not available; skipping font atlas integration build.\n";
return;
}
const std::filesystem::path repoRoot = RepoRoot();
ShaderPackageRegistry registry(4);
ShaderPackage shaderPackage;
@@ -55,7 +72,16 @@ void TestBuildsTextOverlayFontAtlas()
config.cacheRoot = repoRoot / "runtime" / "test_font_cache";
RenderCadenceCompositor::FontAtlasBuilder builder(config);
std::vector<RenderCadenceCompositor::FontAtlasBuildOutput> outputs;
Expect(builder.BuildPackageFontAtlases(shaderPackage, outputs, error), "text overlay font atlas builds");
if (!builder.BuildPackageFontAtlases(shaderPackage, outputs, error))
{
if (IsMsdfAtlasGenToolError(error))
{
std::cout << "SKIP: msdf-atlas-gen could not run in this environment: " << error << "\n";
return;
}
Expect(false, ("text overlay font atlas builds: " + error).c_str());
return;
}
Expect(outputs.size() == 1, "one font atlas output is produced");
if (!outputs.empty())
{

View File

@@ -1,4 +1,5 @@
#include "SupportedShaderCatalog.h"
#include "ShaderPackageRegistry.h"
#include <filesystem>
#include <iostream>
@@ -45,6 +46,32 @@ std::filesystem::path RepoRoot()
return std::filesystem::current_path();
}
bool CanRunMsdfAtlasGen(std::string& reason)
{
const std::filesystem::path repoRoot = RepoRoot();
std::filesystem::path executablePath;
if (!RenderCadenceCompositor::FontAtlasBuilder::FindMsdfAtlasGenExecutable(repoRoot, executablePath))
{
reason = "msdf-atlas-gen executable is not available";
return false;
}
ShaderPackageRegistry registry(4);
ShaderPackage shaderPackage;
if (!registry.ParseManifest(repoRoot / "shaders" / "text-overlay" / "shader.json", shaderPackage, reason))
return false;
RenderCadenceCompositor::FontAtlasBuildConfig config;
config.repoRoot = repoRoot;
config.cacheRoot = repoRoot / "runtime" / "test_font_cache";
RenderCadenceCompositor::FontAtlasBuilder builder(config);
std::vector<RenderCadenceCompositor::FontAtlasBuildOutput> outputs;
if (!builder.BuildPackageFontAtlases(shaderPackage, outputs, reason))
return false;
return true;
}
void SupportsSinglePassStatelessPackage()
{
const ShaderPackage shaderPackage = MakeSinglePassPackage();
@@ -149,6 +176,13 @@ void SupportsTextParametersWithDeclaredFont()
void BuildsDeclaredFontAtlasesDuringCatalogLoad()
{
std::string msdfReason;
if (!CanRunMsdfAtlasGen(msdfReason))
{
std::cout << "SKIP: msdf-atlas-gen could not run in this environment: " << msdfReason << "\n";
return;
}
RenderCadenceCompositor::SupportedShaderCatalog catalog;
std::string error;
Expect(catalog.Load(RepoRoot() / "shaders", 12, error), "shader catalog loads");