[Fix] (MG_Util/Program): fix UniformTraverser and add test for it

This commit is contained in:
2025-07-21 10:47:05 +08:00
parent 0dfd535c40
commit 0afe4c4acb
2 changed files with 65 additions and 1 deletions
@@ -8,9 +8,16 @@ namespace MobileGL {
namespace MG_Util {
namespace ShaderTranspiler {
void UniformTraverser::visitSymbol(glslang::TIntermSymbol *symbol) {
auto parent = getParentNode();
if (!parent)
return;
auto parentAgg = parent->getAsAggregate();
if (!parentAgg || parentAgg->getOp() != glslang::EOpLinkerObjects)
return;
const auto &type = symbol->getType();
if (symbol->getQualifier().isUniform()) {
auto name = symbol->getName();
auto& name = symbol->getName();
auto qualifier = symbol->getQualifier();
auto &uniform = uniforms.emplace_back();