MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / AddVarToEntryPoints

Method AddVarToEntryPoints

source/opt/ir_context.cpp:876–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874}
875
876void IRContext::AddVarToEntryPoints(uint32_t var_id) {
877 uint32_t ocnt = 0;
878 for (auto& e : module()->entry_points()) {
879 bool found = false;
880 e.ForEachInOperand([&ocnt, &found, &var_id](const uint32_t* idp) {
881 if (ocnt >= kEntryPointInterfaceInIdx) {
882 if (*idp == var_id) found = true;
883 }
884 ++ocnt;
885 });
886 if (!found) {
887 e.AddOperand({SPV_OPERAND_TYPE_ID, {var_id}});
888 get_def_use_mgr()->AnalyzeInstDefUse(&e);
889 }
890 }
891}
892
893uint32_t IRContext::GetBuiltinInputVarId(uint32_t builtin) {
894 if (!AreAnalysesValid(kAnalysisBuiltinVarId)) ResetBuiltinAnalysis();

Callers

nothing calls this directly

Calls 4

entry_pointsMethod · 0.80
ForEachInOperandMethod · 0.80
AddOperandMethod · 0.80
AnalyzeInstDefUseMethod · 0.80

Tested by

no test coverage detected