MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / createDebugGlobalVariable

Method createDebugGlobalVariable

SPIRV/SpvBuilder.cpp:1452–1474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1450}
1451
1452Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id const variable)
1453{
1454 assert(type != 0);
1455
1456 Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst);
1457 inst->reserveOperands(11);
1458 inst->addIdOperand(nonSemanticShaderDebugInfo);
1459 inst->addImmediateOperand(NonSemanticShaderDebugInfoDebugGlobalVariable);
1460 inst->addIdOperand(getStringId(name)); // name id
1461 inst->addIdOperand(type); // type id
1462 inst->addIdOperand(makeDebugSource(currentFileId)); // source id
1463 inst->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero?
1464 inst->addIdOperand(makeUintConstant(0)); // TODO: column id
1465 inst->addIdOperand(makeDebugCompilationUnit()); // scope id
1466 inst->addIdOperand(getStringId(name)); // linkage name id
1467 inst->addIdOperand(variable); // variable id
1468 inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsDefinition)); // flags id
1469
1470 constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
1471 module.mapInstruction(inst);
1472
1473 return inst->getResultId();
1474}
1475
1476Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t const argNumber)
1477{

Callers 1

createSpvVariableMethod · 0.80

Calls 6

reserveOperandsMethod · 0.80
addIdOperandMethod · 0.80
addImmediateOperandMethod · 0.80
mapInstructionMethod · 0.80
getResultIdMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected