| 10395 | } |
| 10396 | |
| 10397 | std::string VulkanHppGenerator::generateStruct( std::pair<std::string, StructData> const & structure, std::set<std::string> & listedStructs ) const |
| 10398 | { |
| 10399 | assert( !listedStructs.contains( structure.first ) ); |
| 10400 | |
| 10401 | std::string str; |
| 10402 | for ( auto const & member : structure.second.members ) |
| 10403 | { |
| 10404 | auto typeIt = m_types.find( member.type.name ); |
| 10405 | assert( typeIt != m_types.end() ); |
| 10406 | if ( ( typeIt->second.category == TypeCategory::Struct ) || ( typeIt->second.category == TypeCategory::Union ) ) |
| 10407 | { |
| 10408 | auto structIt = findByNameOrAlias( m_structs, member.type.name ); |
| 10409 | assert( structIt != m_structs.end() ); |
| 10410 | if ( ( structure.first != member.type.name ) && !listedStructs.contains( structIt->first ) ) |
| 10411 | { |
| 10412 | str += generateStruct( *structIt, listedStructs ); |
| 10413 | } |
| 10414 | } |
| 10415 | else if ( typeIt->second.category == TypeCategory::FuncPointer ) |
| 10416 | { |
| 10417 | auto funcPtrIt = m_vkxml.funcPointers.find( member.type.name ); |
| 10418 | assert( funcPtrIt != m_vkxml.funcPointers.end() ); |
| 10419 | if ( !listedStructs.contains( member.type.name ) ) |
| 10420 | { |
| 10421 | str += generateFuncPointer( *funcPtrIt, listedStructs ); |
| 10422 | } |
| 10423 | } |
| 10424 | } |
| 10425 | |
| 10426 | if ( !structure.second.subStruct.empty() ) |
| 10427 | { |
| 10428 | auto structureIt = m_structs.find( structure.second.subStruct ); |
| 10429 | if ( ( structureIt != m_structs.end() ) && !listedStructs.contains( structureIt->first ) ) |
| 10430 | { |
| 10431 | str += generateStruct( *structureIt, listedStructs ); |
| 10432 | } |
| 10433 | } |
| 10434 | |
| 10435 | if ( structure.second.isUnion ) |
| 10436 | { |
| 10437 | str += generateUnion( structure ); |
| 10438 | } |
| 10439 | else |
| 10440 | { |
| 10441 | str += generateStructure( structure ); |
| 10442 | } |
| 10443 | |
| 10444 | listedStructs.insert( structure.first ); |
| 10445 | return str; |
| 10446 | } |
| 10447 | |
| 10448 | std::string VulkanHppGenerator::generateStructCastAssignments( std::pair<std::string, StructData> const & structData ) const |
| 10449 | { |
nothing calls this directly
no test coverage detected