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

Function PrintAnnotations

shadercompiler/EffectCompilerDX11.cpp:578–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578void PrintAnnotations( YamlOutput& listing, const std::map<StringReference, Annotation>& annotations )
579{
580 if( !listing.enabled() )
581 {
582 return;
583 }
584 listing.literal( "annotations" ).list();
585 for( auto a = annotations.begin(); a != annotations.end(); ++a )
586 {
587 listing.dict()
588 .literal( "name" )
589 .literal( g_stringTable.GetString( a->first ) )
590 .literal( "annotationType" );
591 switch( a->second.type )
592 {
593 case ANNOTATION_TYPE_BOOL:
594 listing
595 .literal( "bool" )
596 .literal( "value" )
597 .literal( a->second.intValue != 0 );
598 break;
599 case ANNOTATION_TYPE_INT:
600 listing
601 .literal( "int" )
602 .literal( "value" )
603 .literal( a->second.intValue );
604 break;
605 case ANNOTATION_TYPE_FLOAT:
606 listing
607 .literal( "float" )
608 .literal( "value" )
609 .literal( a->second.floatValue );
610 break;
611 default:
612 listing
613 .literal( "string" )
614 .literal( "value" )
615 .literal( g_stringTable.GetString( a->second.stringValue ) );
616 break;
617 }
618 listing.end();
619 }
620 listing.end();
621}
622
623
624YamlOutput& YamlTextureType( YamlOutput& listing, TextureType type )

Callers 1

PrintStageInfoFunction · 0.70

Calls 4

enabledMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected