| 35 | Dictionary<String, RefPtr<CodeGenBackend>> backends; |
| 36 | |
| 37 | void ResolveAttributes(SymbolTable * symTable) |
| 38 | { |
| 39 | for (auto & shader : symTable->ShaderDependenceOrder) |
| 40 | { |
| 41 | auto comps = shader->GetComponentDependencyOrder(); |
| 42 | for (auto & comp : comps) |
| 43 | { |
| 44 | for (auto & impl : comp->Implementations) |
| 45 | for (auto attrib : impl->SyntaxNode->GetLayoutAttributes()) |
| 46 | { |
| 47 | try |
| 48 | { |
| 49 | if (attrib->GetValue().StartsWith("%")) |
| 50 | { |
| 51 | CoreLib::Text::TokenReader parser(attrib->GetValue().SubString(1, attrib->GetValue().Length() - 1)); |
| 52 | auto compName = parser.ReadWord(); |
| 53 | parser.Read("."); |
| 54 | auto compAttrib = parser.ReadWord(); |
| 55 | RefPtr<ShaderComponentSymbol> compSym; |
| 56 | if (shader->Components.TryGetValue(compName, compSym)) |
| 57 | { |
| 58 | for (auto & timpl : compSym->Implementations) |
| 59 | { |
| 60 | Token attribValue; |
| 61 | if (timpl->SyntaxNode->FindSimpleAttribute(compAttrib, attribValue)) |
| 62 | attrib->Value = attribValue; |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | catch (Exception) |
| 68 | { |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /* Generate a shader variant by applying mechanic choice rules and the choice file. |
| 76 | The choice file provides "preferred" definitions, as represented in ShaderComponentSymbol::Type::PinnedWorlds |
nothing calls this directly
no test coverage detected