MCPcopy Create free account
hub / github.com/csyonghe/Spire / GenerateFunctionDeclaration

Method GenerateFunctionDeclaration

Source/SpireCore/SpirVCodeGen.cpp:4669–4682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4667 }
4668
4669 int GenerateFunctionDeclaration(CompiledFunction *func)
4670 //return the ID of the Function Type
4671 {
4672 List<RefPtr<ILType>> args;
4673 for (auto & instr : *func->Code)
4674 if (auto arg = instr.As<FetchArgInstruction>())
4675 if (arg->ArgId != 0)
4676 {
4677 args.Add(arg->Type);
4678 }
4679 int funcTypeID = ctx.AddInstrTypeFunction(func, args, func->ReturnType);
4680 ctx.FunctionNameToFunctionID[func->Name] = ++ctx.CurrentID;
4681 return funcTypeID;
4682 }
4683
4684 int GenerateFunctionDefinition(CompiledFunction *func, ILOperand *vertexOutput = nullptr)
4685 //return the ID of the Function

Callers 1

GenerateShaderWorldMethod · 0.45

Calls 2

AddInstrTypeFunctionMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected