MCPcopy Create free account
hub / github.com/carbonengine/trinity / FindOutputBySemantics

Function FindOutputBySemantics

shadercompiler/EffectCompilerDX11.cpp:106–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106bool FindOutputBySemantics( ASTNode* node, const char** semantics, std::vector<Symbol*>* path )
107{
108 // check "out" function arguments
109 if( FindParameterBySemantics( node, semantics, path, true ) )
110 {
111 return true;
112 }
113 // check return value if it has semantics
114 if( node->GetSymbol() && node->GetSymbol()->semantic.start )
115 {
116 std::string sematic = ToString( node->GetSymbol()->semantic );
117 for( unsigned i = 0; semantics[i]; ++i )
118 {
119 if( _stricmp( sematic.c_str(), semantics[i] ) == 0 )
120 {
121 if( path )
122 {
123 path->push_back( nullptr );
124 }
125 return true;
126 }
127 }
128 }
129 // finally check return value as a structure
130 if( node->GetType().symbol &&
131 node->GetType().symbol->definition )
132 {
133 for( unsigned i = 0; i < node->GetType().symbol->definition->GetChildrenCount(); ++i )
134 {
135 if( FindParameterBySemantics( node->GetType().symbol->definition->GetChild( i ), semantics, path ) )
136 {
137 if( path )
138 {
139 path->insert( path->begin(), nullptr );
140 }
141 return true;
142 }
143 }
144 }
145 return false;
146}
147
148void PrintValuePath( std::ostream& os, const std::vector<Symbol*>& path, const char* functionSymbol )
149{

Callers 2

PatchSemanticsFunction · 0.85
PatchShaderFunction · 0.85

Calls 7

FindParameterBySemanticsFunction · 0.85
GetSymbolMethod · 0.80
GetChildrenCountMethod · 0.80
ToStringFunction · 0.70
GetTypeMethod · 0.45
GetChildMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected