Given a function header, gathers all inputs for [[stage_in]] into a flat structure
| 2331 | |
| 2332 | // Given a function header, gathers all inputs for [[stage_in]] into a flat structure |
| 2333 | void GatherInputs( ASTNode* destStruct, std::vector<ASTNode*>& accessors, const std::vector<Symbol*>& params, ASTNode* header, ParserState& state ) |
| 2334 | { |
| 2335 | for( size_t i = 0; i < header->GetChildrenCount(); ++i ) |
| 2336 | { |
| 2337 | auto arg = header->GetChild( i ); |
| 2338 | |
| 2339 | if( IsUniformInputArgument( arg ) || arg->GetSymbol()->addressSpace != AddressSpace::None ) |
| 2340 | { |
| 2341 | continue; |
| 2342 | } |
| 2343 | bool isIn = arg->GetToken() == 0 || arg->GetToken()->type == OP_IN; |
| 2344 | if( !isIn ) |
| 2345 | { |
| 2346 | continue; |
| 2347 | } |
| 2348 | |
| 2349 | Symbol* symbol = arg->GetSymbol(); |
| 2350 | if( !symbol ) |
| 2351 | { |
| 2352 | continue; |
| 2353 | } |
| 2354 | |
| 2355 | if( HasSystemRegister( symbol ) ) |
| 2356 | { |
| 2357 | continue; |
| 2358 | } |
| 2359 | |
| 2360 | if( !params[i] ) |
| 2361 | { |
| 2362 | continue; |
| 2363 | } |
| 2364 | |
| 2365 | if( symbol->type.IsStruct() ) |
| 2366 | { |
| 2367 | GatherFields( destStruct, accessors, NewVarIdentifier( state, params[i] ), symbol->type.symbol->definition, state ); |
| 2368 | } |
| 2369 | else if( symbol->type.IsScalarOrVector() ) |
| 2370 | { |
| 2371 | destStruct->AddChild( NewStructMember( state, symbol ) ); |
| 2372 | accessors.push_back( NewVarIdentifier( state, params[i] ) ); |
| 2373 | } |
| 2374 | } |
| 2375 | } |
| 2376 | |
| 2377 | void GatherSystemInputs( ASTNode* destStruct, std::vector<ASTNode*>& accessors, std::vector<ASTNode*>& argumentAccessors, const std::vector<Symbol*>& params, ASTNode* header, ASTNode* shaderBody, ParserState& state ) |
| 2378 | { |
no test coverage detected