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

Function CreateShaderTableArgument

shadercompiler/EffectCompilerMetal.cpp:861–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861ASTNode* CreateShaderTableArgument( ParserState& state, const Type& payloadType, ScopeSymbolTable* scope )
862{
863 std::string shaderTableTypeName = "ShaderTableT<" + payloadType.ToString() + ",__RtGlobalInput>";
864 auto t = scope->AddSymbol( state.AllocateName( shaderTableTypeName.c_str() ), DISALOW_OVERRIDES );
865 t->isTypeName = true;
866
867 auto shaderTable = state.NewNode( NT_FUNCTION_PARAMETER );
868 auto symbol = scope->AddSymbol( MakeInlineString( "__rtShaderTable" ), DISALOW_OVERRIDES );
869 symbol->type = TypeFromSymbol( t );
870 symbol->definition = shaderTable;
871 symbol->registerSpecifier[MakeInlineString( "" )] = RegisterSpecifier::Register( MetalRegister::SRV, 2 );
872 symbol->addressSpace = AddressSpace::Constant;
873 shaderTable->SetType( symbol->type );
874 shaderTable->SetSymbol( symbol );
875 shaderTable->AddChild( nullptr );
876 shaderTable->SetToken( ScannerToken::FromTokenType( OP_INOUT ) );
877
878 return shaderTable;
879}
880
881void AddShaderTableArguments( ParserState& state, const std::map<Symbol*, ASTNode*>& functions )
882{

Callers 2

AddShaderTableArgumentsFunction · 0.85
PatchRtShaderFunction · 0.85

Calls 10

MakeInlineStringFunction · 0.85
TypeFromSymbolFunction · 0.85
AddSymbolMethod · 0.80
AllocateNameMethod · 0.80
NewNodeMethod · 0.80
SetSymbolMethod · 0.80
AddChildMethod · 0.80
SetTokenMethod · 0.80
ToStringMethod · 0.45
SetTypeMethod · 0.45

Tested by

no test coverage detected