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

Function ClassifyRtShaderArguments

shadercompiler/EffectCompilerMetal.cpp:3047–3076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3045};
3046
3047RtShaderSourceArguments ClassifyRtShaderArguments( ASTNode* functionHeader )
3048{
3049 RtShaderSourceArguments result;
3050
3051 for( size_t i = 0; i < functionHeader->GetChildrenCount(); ++i )
3052 {
3053 ASTNode* sourceArg = functionHeader->GetChild( i );
3054 Symbol* sourceSymbol = sourceArg->GetSymbol();
3055
3056 bool isPayload = sourceArg->GetType().IsStruct() && sourceSymbol->addressSpace == AddressSpace::None && !result.payloadArg;
3057 bool isAttribute = sourceArg->GetType().IsStruct() && sourceSymbol->addressSpace == AddressSpace::None && result.payloadArg;
3058 if( isPayload )
3059 {
3060 result.payloadArg = sourceArg;
3061 }
3062 else if( isAttribute )
3063 {
3064 result.attributeArg = sourceArg;
3065 }
3066 else if( sourceArg->GetType().symbol && ContainsSubstring( sourceArg->GetType().symbol->name, "ShaderTableT<" ) )
3067 {
3068 result.shaderTableArg = sourceArg;
3069 }
3070 else
3071 {
3072 result.other.push_back( sourceArg );
3073 }
3074 }
3075 return result;
3076}
3077
3078ASTNode* PatchRtShader( RtShaderType shaderType, ASTNode* callNode, ParserState& state, std::vector<Symbol*>& rtConstantBuffers, const std::vector<GlobalInputElement>& globalInput, ASTNode* globalInputsStruct )
3079{

Callers 1

PatchRtShaderFunction · 0.85

Calls 6

ContainsSubstringFunction · 0.85
GetChildrenCountMethod · 0.80
GetSymbolMethod · 0.80
IsStructMethod · 0.80
GetChildMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected