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

Function ApplyPackedModifier

shadercompiler/EffectCompilerMetal.cpp:2576–2593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2574}
2575
2576void ApplyPackedModifier( ASTNode* structNode, bool tightPacking )
2577{
2578 for( auto member : structNode->GetChildren() )
2579 {
2580 for( auto var : member->GetChildren() )
2581 {
2582 auto& type = var->GetSymbol()->type;
2583 if( type.IsVector() && ( tightPacking || type.width == 3 ) && type.builtInType != OP_BOOL )
2584 {
2585 type.modifier = OP_PACKOFFSET; // let us abuse this token type!
2586 }
2587 else if( type.IsStruct() )
2588 {
2589 ApplyPackedModifier( type.symbol->definition, tightPacking );
2590 }
2591 }
2592 }
2593}
2594
2595void ApplyPackedModifiersToConstantBuffers( ASTNode* functionDefinition )
2596{

Callers 1

Calls 3

GetSymbolMethod · 0.80
IsVectorMethod · 0.80
IsStructMethod · 0.80

Tested by

no test coverage detected