added optional web component UI control
All checks were successful
CI / React UI Build (push) Successful in 12s
CI / Native Windows Build And Tests (push) Successful in 2m20s
CI / Windows Release Package (push) Successful in 2m56s

This commit is contained in:
Aiden
2026-05-30 22:57:59 +10:00
parent a6d2ee385e
commit 27690c3afa
26 changed files with 804 additions and 76 deletions

View File

@@ -181,6 +181,27 @@ inline void WriteFeedbackJson(JsonWriter& writer, const FeedbackSettings& feedba
writer.EndObject();
}
inline std::string ShaderAssetUrl(const std::string& shaderId, const std::string& assetPath)
{
return "/shader-assets/" + shaderId + "/" + assetPath;
}
inline void WriteShaderUiJson(JsonWriter& writer, const std::string& shaderId, const ShaderUiDefinition& ui)
{
if (!ui.enabled)
{
writer.Null();
return;
}
writer.BeginObject();
writer.KeyString("type", ui.type);
writer.KeyString("entry", ui.entryPath);
writer.KeyString("tag", ui.customElementTag);
writer.KeyString("assetUrl", ShaderAssetUrl(shaderId, ui.entryPath));
writer.EndObject();
}
inline const char* RuntimeLayerBuildStateName(RuntimeLayerBuildState state)
{
switch (state)
@@ -276,6 +297,8 @@ inline void WriteShaderCatalogJson(JsonWriter& writer, const SupportedShaderCata
writer.KeyString("category", shader.category);
writer.KeyBool("available", true);
writer.KeyNull("error");
writer.Key("ui");
WriteShaderUiJson(writer, shader.id, shader.ui);
writer.EndObject();
}
writer.EndArray();
@@ -304,6 +327,11 @@ inline void WriteRuntimeShaderLayersJson(
writer.KeyString("buildState", RuntimeLayerBuildStateName(layer.buildState));
writer.KeyBool("renderReady", layer.renderReady);
writer.KeyString("message", layer.message);
writer.Key("ui");
if (shaderPackage)
WriteShaderUiJson(writer, shaderPackage->id, shaderPackage->ui);
else
writer.Null();
writer.Key("temporal");
if (shaderPackage)
WriteTemporalJson(writer, shaderPackage->temporal);