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

Function ExtractAnnotations

shadercompiler/EffectCompilerMetal.cpp:3799–3828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3797}
3798
3799bool ExtractAnnotations( const InlineString& name, ParserState& state, ParameterAnnotation& paramAnnotations, bool* srgb, bool* autoregister )
3800{
3801 paramAnnotations.annotations.clear();
3802
3803 bool localSrgb = false;
3804 bool localAutoregister = false;
3805
3806 auto globalSymbol = state.GetSymbolTable().LookupGlobal( ToString( name ).c_str() );
3807 if( globalSymbol && globalSymbol->annotations )
3808 {
3809
3810 for( auto& ai : *globalSymbol->annotations )
3811 {
3812 Annotation result;
3813 if( MakeEffectAnnotationFromSymbolAnnotation( ai, result, localSrgb, localAutoregister ) )
3814 {
3815 paramAnnotations.annotations[g_stringTable.AddString( ai.name )] = result;
3816 }
3817 }
3818 }
3819 if( srgb )
3820 {
3821 *srgb = localSrgb;
3822 }
3823 if( autoregister )
3824 {
3825 *autoregister = localAutoregister;
3826 }
3827 return !paramAnnotations.annotations.empty();
3828}
3829
3830bool CollectConstants( ParserState& state, StageData& stage, std::map<StringReference, ParameterAnnotation>& annotations )
3831{

Callers 1

GetStageDataForNodeFunction · 0.85

Calls 5

LookupGlobalMethod · 0.80
AddStringMethod · 0.80
emptyMethod · 0.80
ToStringFunction · 0.70

Tested by

no test coverage detected