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

Function PatchCBuffers

shadercompiler/ParserUtils.cpp:563–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563static void PatchCBuffers( ParserState& state, ASTNode* parent, unsigned& index )
564{
565 ASTNode* node = parent->GetChild( index );
566 if( node == nullptr )
567 {
568 return;
569 }
570 if( node->GetNodeType() == NT_NAME_DECLARATION )
571 {
572 int cbufferIndex = GetCBufferIndex( node->GetSymbol() );
573 if( cbufferIndex >= 0 )
574 {
575 ASTNode* shadowStruct;
576 ASTNode* cbuffer = AddCBuffer( state, node, cbufferIndex, shadowStruct );
577
578 cbuffer->AddChild( node );
579 parent->RemoveChild( index );
580 if( shadowStruct )
581 {
582 parent->InsertChild( index++, shadowStruct );
583 }
584 parent->InsertChild( index, cbuffer );
585 }
586 }
587 for( unsigned i = 0; i < node->GetChildrenCount(); ++i )
588 {
589 PatchCBuffers( state, node, i );
590 }
591}
592
593void PatchCBuffers( ParserState& state )
594{

Callers 1

CompileEffectMethod · 0.85

Calls 10

GetCBufferIndexFunction · 0.85
AddCBufferFunction · 0.85
GetNodeTypeMethod · 0.80
GetSymbolMethod · 0.80
AddChildMethod · 0.80
RemoveChildMethod · 0.80
InsertChildMethod · 0.80
GetChildrenCountMethod · 0.80
GetTreeMethod · 0.80
GetChildMethod · 0.45

Tested by

no test coverage detected